- api/openapi.yaml converted 3.1 → 3.0.3 (oapi-codegen/kin-openapi supports 3.0; nullable syntax + example keywords), still redocly-clean - oapi-codegen (v2.4.1, strict server + chi) generates internal/httpapi/gen from the spec; `make generate` wired - internal/httpapi: chi router, /healthz (unauthenticated, SG18), RFC 9457 problem+json mapping from domain sentinels (SG11), 5xx detail logged server-side only, request logging with request IDs, graceful shutdown (SG4), interim static bearer auth (constant-time; dev-open when no token; OIDC JWT still to come in Phase 2) - Implemented: listEntities (type filter walks the hierarchy, keyset pagination), getEntity (UUID or slug, ETag), getEntityRelations, getBlastRadius, getGraph (nodes+edges for UIs), getOntology, listSignals, getFleetHealth, exportSeeds. Remaining 38 ops return 501 problem+json stubs (compiler-enforced interface completeness) - `oikos api` role live: migrate-on-start, serves :8090 - 15 API integration tests (auth, pagination, hierarchy filter, ETag, 404/501 problem shapes, graph, export) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
7568 lines
256 KiB
Go
7568 lines
256 KiB
Go
// Package gen provides primitives to interact with the openapi HTTP API.
|
|
//
|
|
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
|
|
package gen
|
|
|
|
import (
|
|
"bytes"
|
|
"compress/gzip"
|
|
"context"
|
|
"encoding/base64"
|
|
"encoding/json"
|
|
"fmt"
|
|
"io"
|
|
"net/http"
|
|
"net/url"
|
|
"path"
|
|
"strings"
|
|
"time"
|
|
|
|
"github.com/getkin/kin-openapi/openapi3"
|
|
"github.com/go-chi/chi/v5"
|
|
"github.com/oapi-codegen/runtime"
|
|
strictnethttp "github.com/oapi-codegen/runtime/strictmiddleware/nethttp"
|
|
openapi_types "github.com/oapi-codegen/runtime/types"
|
|
)
|
|
|
|
const (
|
|
BearerAuthScopes = "bearerAuth.Scopes"
|
|
)
|
|
|
|
// Defines values for AgentActivityActivityType.
|
|
const (
|
|
Decision AgentActivityActivityType = "decision"
|
|
Escalation AgentActivityActivityType = "escalation"
|
|
McpQuery AgentActivityActivityType = "mcp_query"
|
|
Reasoning AgentActivityActivityType = "reasoning"
|
|
ToolCall AgentActivityActivityType = "tool_call"
|
|
)
|
|
|
|
// Defines values for ApprovalKind.
|
|
const (
|
|
ApprovalKindExecution ApprovalKind = "execution"
|
|
ApprovalKindPatternActivation ApprovalKind = "pattern-activation"
|
|
ApprovalKindPolicyChange ApprovalKind = "policy-change"
|
|
)
|
|
|
|
// Defines values for ApprovalStatus.
|
|
const (
|
|
ApprovalStatusApproved ApprovalStatus = "approved"
|
|
ApprovalStatusDenied ApprovalStatus = "denied"
|
|
ApprovalStatusExpired ApprovalStatus = "expired"
|
|
ApprovalStatusPending ApprovalStatus = "pending"
|
|
ApprovalStatusRevoked ApprovalStatus = "revoked"
|
|
)
|
|
|
|
// Defines values for ApprovalRuleAutonomyLevel.
|
|
const (
|
|
ApprovalRuleAutonomyLevelAuto ApprovalRuleAutonomyLevel = "auto"
|
|
ApprovalRuleAutonomyLevelEscalate ApprovalRuleAutonomyLevel = "escalate"
|
|
ApprovalRuleAutonomyLevelNever ApprovalRuleAutonomyLevel = "never"
|
|
)
|
|
|
|
// Defines values for ApprovalRuleCreateAutonomyLevel.
|
|
const (
|
|
ApprovalRuleCreateAutonomyLevelAuto ApprovalRuleCreateAutonomyLevel = "auto"
|
|
ApprovalRuleCreateAutonomyLevelEscalate ApprovalRuleCreateAutonomyLevel = "escalate"
|
|
ApprovalRuleCreateAutonomyLevelNever ApprovalRuleCreateAutonomyLevel = "never"
|
|
)
|
|
|
|
// Defines values for AuditEntryActorType.
|
|
const (
|
|
AuditEntryActorTypeAgent AuditEntryActorType = "agent"
|
|
AuditEntryActorTypeOperator AuditEntryActorType = "operator"
|
|
AuditEntryActorTypeScheduler AuditEntryActorType = "scheduler"
|
|
AuditEntryActorTypeSystem AuditEntryActorType = "system"
|
|
)
|
|
|
|
// Defines values for CheckKind.
|
|
const (
|
|
CheckKindCertExpiry CheckKind = "cert-expiry"
|
|
CheckKindDisk CheckKind = "disk"
|
|
CheckKindDrift CheckKind = "drift"
|
|
CheckKindHttp CheckKind = "http"
|
|
CheckKindSshScript CheckKind = "ssh-script"
|
|
CheckKindTcp CheckKind = "tcp"
|
|
)
|
|
|
|
// Defines values for CheckCreateKind.
|
|
const (
|
|
CheckCreateKindCertExpiry CheckCreateKind = "cert-expiry"
|
|
CheckCreateKindDisk CheckCreateKind = "disk"
|
|
CheckCreateKindDrift CheckCreateKind = "drift"
|
|
CheckCreateKindHttp CheckCreateKind = "http"
|
|
CheckCreateKindSshScript CheckCreateKind = "ssh-script"
|
|
CheckCreateKindTcp CheckCreateKind = "tcp"
|
|
)
|
|
|
|
// Defines values for ClassificationRoute.
|
|
const (
|
|
ClassificationRouteAutoAct ClassificationRoute = "auto-act"
|
|
ClassificationRouteEscalate ClassificationRoute = "escalate"
|
|
ClassificationRouteHold ClassificationRoute = "hold"
|
|
)
|
|
|
|
// Defines values for EntityTypeLayer.
|
|
const (
|
|
EntityTypeLayerCognition EntityTypeLayer = "cognition"
|
|
EntityTypeLayerGovernance EntityTypeLayer = "governance"
|
|
EntityTypeLayerInfrastructure EntityTypeLayer = "infrastructure"
|
|
EntityTypeLayerMeta EntityTypeLayer = "meta"
|
|
)
|
|
|
|
// Defines values for EntityTypeStatus.
|
|
const (
|
|
EntityTypeStatusActive EntityTypeStatus = "active"
|
|
EntityTypeStatusDeprecated EntityTypeStatus = "deprecated"
|
|
)
|
|
|
|
// Defines values for EntityTypeCreateLayer.
|
|
const (
|
|
EntityTypeCreateLayerCognition EntityTypeCreateLayer = "cognition"
|
|
EntityTypeCreateLayerGovernance EntityTypeCreateLayer = "governance"
|
|
EntityTypeCreateLayerInfrastructure EntityTypeCreateLayer = "infrastructure"
|
|
)
|
|
|
|
// Defines values for EntityTypePatchStatus.
|
|
const (
|
|
EntityTypePatchStatusActive EntityTypePatchStatus = "active"
|
|
EntityTypePatchStatusDeprecated EntityTypePatchStatus = "deprecated"
|
|
)
|
|
|
|
// Defines values for EventSeverity.
|
|
const (
|
|
EventSeverityCritical EventSeverity = "critical"
|
|
EventSeverityInfo EventSeverity = "info"
|
|
EventSeverityWarning EventSeverity = "warning"
|
|
)
|
|
|
|
// Defines values for ExecutionStatus.
|
|
const (
|
|
ExecutionStatusApproved ExecutionStatus = "approved"
|
|
ExecutionStatusAutoApproved ExecutionStatus = "auto_approved"
|
|
ExecutionStatusCancelled ExecutionStatus = "cancelled"
|
|
ExecutionStatusDenied ExecutionStatus = "denied"
|
|
ExecutionStatusExecuting ExecutionStatus = "executing"
|
|
ExecutionStatusExpired ExecutionStatus = "expired"
|
|
ExecutionStatusFailed ExecutionStatus = "failed"
|
|
ExecutionStatusProposed ExecutionStatus = "proposed"
|
|
ExecutionStatusRollbackFailed ExecutionStatus = "rollback_failed"
|
|
ExecutionStatusRolledBack ExecutionStatus = "rolled_back"
|
|
ExecutionStatusTimedOut ExecutionStatus = "timed_out"
|
|
ExecutionStatusVerified ExecutionStatus = "verified"
|
|
ExecutionStatusVerifying ExecutionStatus = "verifying"
|
|
)
|
|
|
|
// Defines values for HealthSummaryEntitiesHealth.
|
|
const (
|
|
HealthSummaryEntitiesHealthDegraded HealthSummaryEntitiesHealth = "degraded"
|
|
HealthSummaryEntitiesHealthDown HealthSummaryEntitiesHealth = "down"
|
|
HealthSummaryEntitiesHealthHealthy HealthSummaryEntitiesHealth = "healthy"
|
|
HealthSummaryEntitiesHealthUnknown HealthSummaryEntitiesHealth = "unknown"
|
|
)
|
|
|
|
// Defines values for HealthSummaryEntitiesTrend.
|
|
const (
|
|
HealthSummaryEntitiesTrendDegrading HealthSummaryEntitiesTrend = "degrading"
|
|
HealthSummaryEntitiesTrendImproving HealthSummaryEntitiesTrend = "improving"
|
|
HealthSummaryEntitiesTrendStable HealthSummaryEntitiesTrend = "stable"
|
|
HealthSummaryEntitiesTrendUnknown HealthSummaryEntitiesTrend = "unknown"
|
|
)
|
|
|
|
// Defines values for KnowledgeHitType.
|
|
const (
|
|
Document KnowledgeHitType = "document"
|
|
Investigation KnowledgeHitType = "investigation"
|
|
Runbook KnowledgeHitType = "runbook"
|
|
)
|
|
|
|
// Defines values for MetricSeriesRollup.
|
|
const (
|
|
MetricSeriesRollupN1d MetricSeriesRollup = "1d"
|
|
MetricSeriesRollupN1h MetricSeriesRollup = "1h"
|
|
MetricSeriesRollupRaw MetricSeriesRollup = "raw"
|
|
)
|
|
|
|
// Defines values for PatternStatus.
|
|
const (
|
|
PatternStatusActive PatternStatus = "active"
|
|
PatternStatusDeprecated PatternStatus = "deprecated"
|
|
PatternStatusHypothesized PatternStatus = "hypothesized"
|
|
PatternStatusInvalidated PatternStatus = "invalidated"
|
|
PatternStatusValidated PatternStatus = "validated"
|
|
)
|
|
|
|
// Defines values for RelationshipTypeCardinality.
|
|
const (
|
|
ManyToMany RelationshipTypeCardinality = "many-to-many"
|
|
ManyToOne RelationshipTypeCardinality = "many-to-one"
|
|
OneToMany RelationshipTypeCardinality = "one-to-many"
|
|
OneToOne RelationshipTypeCardinality = "one-to-one"
|
|
)
|
|
|
|
// Defines values for RiskClassApprovalRequired.
|
|
const (
|
|
RiskClassApprovalRequiredNone RiskClassApprovalRequired = "none"
|
|
RiskClassApprovalRequiredOperator RiskClassApprovalRequired = "operator"
|
|
RiskClassApprovalRequiredOperatorConfirmed RiskClassApprovalRequired = "operator_confirmed"
|
|
)
|
|
|
|
// Defines values for SignalSeverity.
|
|
const (
|
|
SignalSeverityCritical SignalSeverity = "critical"
|
|
SignalSeverityInfo SignalSeverity = "info"
|
|
SignalSeverityWarning SignalSeverity = "warning"
|
|
)
|
|
|
|
// Defines values for SignalState.
|
|
const (
|
|
Acknowledged SignalState = "acknowledged"
|
|
Acting SignalState = "acting"
|
|
Failed SignalState = "failed"
|
|
Muted SignalState = "muted"
|
|
Raised SignalState = "raised"
|
|
Resolved SignalState = "resolved"
|
|
)
|
|
|
|
// Defines values for SkillStatus.
|
|
const (
|
|
SkillStatusActive SkillStatus = "active"
|
|
SkillStatusDeprecated SkillStatus = "deprecated"
|
|
SkillStatusDrafted SkillStatus = "drafted"
|
|
SkillStatusFailed SkillStatus = "failed"
|
|
SkillStatusRefined SkillStatus = "refined"
|
|
SkillStatusTested SkillStatus = "tested"
|
|
)
|
|
|
|
// Defines values for SkillStepRunner.
|
|
const (
|
|
Http SkillStepRunner = "http"
|
|
Internal SkillStepRunner = "internal"
|
|
Ssh SkillStepRunner = "ssh"
|
|
)
|
|
|
|
// Defines values for TrendDirection.
|
|
const (
|
|
Degrading TrendDirection = "degrading"
|
|
Improving TrendDirection = "improving"
|
|
Stable TrendDirection = "stable"
|
|
Unknown TrendDirection = "unknown"
|
|
)
|
|
|
|
// Defines values for ListApprovalsParamsStatus.
|
|
const (
|
|
Approved ListApprovalsParamsStatus = "approved"
|
|
Denied ListApprovalsParamsStatus = "denied"
|
|
Expired ListApprovalsParamsStatus = "expired"
|
|
Pending ListApprovalsParamsStatus = "pending"
|
|
Revoked ListApprovalsParamsStatus = "revoked"
|
|
)
|
|
|
|
// Defines values for ListApprovalsParamsKind.
|
|
const (
|
|
ListApprovalsParamsKindExecution ListApprovalsParamsKind = "execution"
|
|
ListApprovalsParamsKindPatternActivation ListApprovalsParamsKind = "pattern-activation"
|
|
ListApprovalsParamsKindPolicyChange ListApprovalsParamsKind = "policy-change"
|
|
)
|
|
|
|
// Defines values for DecideApprovalJSONBodyDecision.
|
|
const (
|
|
Approve DecideApprovalJSONBodyDecision = "approve"
|
|
Deny DecideApprovalJSONBodyDecision = "deny"
|
|
Revoke DecideApprovalJSONBodyDecision = "revoke"
|
|
)
|
|
|
|
// Defines values for ListClassificationsParamsRoute.
|
|
const (
|
|
ListClassificationsParamsRouteAutoAct ListClassificationsParamsRoute = "auto-act"
|
|
ListClassificationsParamsRouteEscalate ListClassificationsParamsRoute = "escalate"
|
|
ListClassificationsParamsRouteHold ListClassificationsParamsRoute = "hold"
|
|
)
|
|
|
|
// Defines values for GetEntityRelationsParamsDirection.
|
|
const (
|
|
Both GetEntityRelationsParamsDirection = "both"
|
|
In GetEntityRelationsParamsDirection = "in"
|
|
Out GetEntityRelationsParamsDirection = "out"
|
|
)
|
|
|
|
// Defines values for QueryMetricsParamsRollup.
|
|
const (
|
|
QueryMetricsParamsRollupAuto QueryMetricsParamsRollup = "auto"
|
|
QueryMetricsParamsRollupN1d QueryMetricsParamsRollup = "1d"
|
|
QueryMetricsParamsRollupN1h QueryMetricsParamsRollup = "1h"
|
|
QueryMetricsParamsRollupRaw QueryMetricsParamsRollup = "raw"
|
|
)
|
|
|
|
// Defines values for PatchPatternJSONBodyStatus.
|
|
const (
|
|
PatchPatternJSONBodyStatusActive PatchPatternJSONBodyStatus = "active"
|
|
PatchPatternJSONBodyStatusDeprecated PatchPatternJSONBodyStatus = "deprecated"
|
|
PatchPatternJSONBodyStatusInvalidated PatchPatternJSONBodyStatus = "invalidated"
|
|
PatchPatternJSONBodyStatusValidated PatchPatternJSONBodyStatus = "validated"
|
|
)
|
|
|
|
// Defines values for ListSignalsParamsSeverity.
|
|
const (
|
|
Critical ListSignalsParamsSeverity = "critical"
|
|
Info ListSignalsParamsSeverity = "info"
|
|
Warning ListSignalsParamsSeverity = "warning"
|
|
)
|
|
|
|
// Defines values for PatchSkillJSONBodyStatus.
|
|
const (
|
|
PatchSkillJSONBodyStatusActive PatchSkillJSONBodyStatus = "active"
|
|
PatchSkillJSONBodyStatusDeprecated PatchSkillJSONBodyStatus = "deprecated"
|
|
PatchSkillJSONBodyStatusTested PatchSkillJSONBodyStatus = "tested"
|
|
)
|
|
|
|
// AgentActivity defines model for AgentActivity.
|
|
type AgentActivity struct {
|
|
ActivityType AgentActivityActivityType `json:"activity_type"`
|
|
AgentId string `json:"agent_id"`
|
|
CorrelationId *string `json:"correlation_id"`
|
|
DurationMs *int `json:"duration_ms"`
|
|
EntityId *string `json:"entity_id"`
|
|
Id int `json:"id"`
|
|
InputSummary *string `json:"input_summary"`
|
|
OutputSummary *string `json:"output_summary"`
|
|
SessionId *string `json:"session_id"`
|
|
Success *bool `json:"success"`
|
|
TokenCount *int `json:"token_count"`
|
|
ToolName *string `json:"tool_name"`
|
|
Ts time.Time `json:"ts"`
|
|
}
|
|
|
|
// AgentActivityActivityType defines model for AgentActivity.ActivityType.
|
|
type AgentActivityActivityType string
|
|
|
|
// Approval defines model for Approval.
|
|
type Approval struct {
|
|
Action string `json:"action"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
DecidedAt *time.Time `json:"decided_at"`
|
|
DecidedBy *string `json:"decided_by"`
|
|
ExpiresAt time.Time `json:"expires_at"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
Kind ApprovalKind `json:"kind"`
|
|
|
|
// Payload e.g. proposed policy diff
|
|
Payload *map[string]interface{} `json:"payload"`
|
|
RiskClass string `json:"risk_class"`
|
|
Slug string `json:"slug"`
|
|
Status ApprovalStatus `json:"status"`
|
|
|
|
// Subject Entity slug the approval concerns
|
|
Subject *string `json:"subject"`
|
|
}
|
|
|
|
// ApprovalKind defines model for Approval.Kind.
|
|
type ApprovalKind string
|
|
|
|
// ApprovalStatus defines model for Approval.Status.
|
|
type ApprovalStatus string
|
|
|
|
// ApprovalRule defines model for ApprovalRule.
|
|
type ApprovalRule struct {
|
|
Action string `json:"action"`
|
|
AutonomyLevel ApprovalRuleAutonomyLevel `json:"autonomy_level"`
|
|
|
|
// EntityType May be abstract (inherits down)
|
|
EntityType *string `json:"entity_type"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
RiskClass string `json:"risk_class"`
|
|
|
|
// ScopeEntity Entity slug for per-entity overrides
|
|
ScopeEntity *string `json:"scope_entity"`
|
|
Version int `json:"version"`
|
|
}
|
|
|
|
// ApprovalRuleAutonomyLevel defines model for ApprovalRule.AutonomyLevel.
|
|
type ApprovalRuleAutonomyLevel string
|
|
|
|
// ApprovalRuleCreate defines model for ApprovalRuleCreate.
|
|
type ApprovalRuleCreate struct {
|
|
Action string `json:"action"`
|
|
AutonomyLevel ApprovalRuleCreateAutonomyLevel `json:"autonomy_level"`
|
|
EntityType *string `json:"entity_type,omitempty"`
|
|
RiskClass string `json:"risk_class"`
|
|
ScopeEntity *string `json:"scope_entity,omitempty"`
|
|
}
|
|
|
|
// ApprovalRuleCreateAutonomyLevel defines model for ApprovalRuleCreate.AutonomyLevel.
|
|
type ApprovalRuleCreateAutonomyLevel string
|
|
|
|
// AuditEntry defines model for AuditEntry.
|
|
type AuditEntry struct {
|
|
Action string `json:"action"`
|
|
ActorId *string `json:"actor_id"`
|
|
ActorType AuditEntryActorType `json:"actor_type"`
|
|
CorrelationId *string `json:"correlation_id"`
|
|
Detail *map[string]interface{} `json:"detail,omitempty"`
|
|
EntityId *string `json:"entity_id"`
|
|
Id int `json:"id"`
|
|
Method *string `json:"method"`
|
|
Path *string `json:"path"`
|
|
SourceIp *string `json:"source_ip"`
|
|
StatusCode *int `json:"status_code"`
|
|
Ts time.Time `json:"ts"`
|
|
}
|
|
|
|
// AuditEntryActorType defines model for AuditEntry.ActorType.
|
|
type AuditEntryActorType string
|
|
|
|
// AutonomySetting defines model for AutonomySetting.
|
|
type AutonomySetting struct {
|
|
Key string `json:"key"`
|
|
UpdatedAt *time.Time `json:"updated_at,omitempty"`
|
|
Value string `json:"value"`
|
|
Version int `json:"version"`
|
|
}
|
|
|
|
// Check defines model for Check.
|
|
type Check struct {
|
|
// Config Validated per-kind
|
|
Config *map[string]interface{} `json:"config,omitempty"`
|
|
Enabled bool `json:"enabled"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
IntervalS int `json:"interval_s"`
|
|
Kind CheckKind `json:"kind"`
|
|
Slug string `json:"slug"`
|
|
|
|
// Target Entity slug (instance-scoped)
|
|
Target *string `json:"target"`
|
|
|
|
// TargetType Entity type (type-scoped)
|
|
TargetType *string `json:"target_type"`
|
|
TimeoutS int `json:"timeout_s"`
|
|
Version int `json:"version"`
|
|
Zone *string `json:"zone"`
|
|
}
|
|
|
|
// CheckKind defines model for Check.Kind.
|
|
type CheckKind string
|
|
|
|
// CheckCreate defines model for CheckCreate.
|
|
type CheckCreate struct {
|
|
Config *map[string]interface{} `json:"config,omitempty"`
|
|
Enabled *bool `json:"enabled,omitempty"`
|
|
IntervalS *int `json:"interval_s,omitempty"`
|
|
Kind CheckCreateKind `json:"kind"`
|
|
Slug string `json:"slug"`
|
|
Target *string `json:"target,omitempty"`
|
|
TargetType *string `json:"target_type,omitempty"`
|
|
TimeoutS *int `json:"timeout_s,omitempty"`
|
|
Zone *string `json:"zone,omitempty"`
|
|
}
|
|
|
|
// CheckCreateKind defines model for CheckCreate.Kind.
|
|
type CheckCreateKind string
|
|
|
|
// CheckPatch defines model for CheckPatch.
|
|
type CheckPatch struct {
|
|
Config *map[string]interface{} `json:"config,omitempty"`
|
|
Enabled *bool `json:"enabled,omitempty"`
|
|
IntervalS *int `json:"interval_s,omitempty"`
|
|
TimeoutS *int `json:"timeout_s,omitempty"`
|
|
}
|
|
|
|
// Classification defines model for Classification.
|
|
type Classification struct {
|
|
Action string `json:"action"`
|
|
AutonomyCheck *string `json:"autonomy_check,omitempty"`
|
|
BlastRadius *[]string `json:"blast_radius,omitempty"`
|
|
CorrelationId string `json:"correlation_id"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
PatternConfidence *float32 `json:"pattern_confidence"`
|
|
Reasoning map[string]interface{} `json:"reasoning"`
|
|
RecommendedAction *map[string]interface{} `json:"recommended_action"`
|
|
RiskClass string `json:"risk_class"`
|
|
Route ClassificationRoute `json:"route"`
|
|
SignalId *string `json:"signal_id"`
|
|
SkillId *string `json:"skill_id"`
|
|
Target *string `json:"target"`
|
|
}
|
|
|
|
// ClassificationRoute defines model for Classification.Route.
|
|
type ClassificationRoute string
|
|
|
|
// Entity defines model for Entity.
|
|
type Entity struct {
|
|
Attributes *map[string]interface{} `json:"attributes,omitempty"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
MaintenanceUntil *time.Time `json:"maintenance_until"`
|
|
Name string `json:"name"`
|
|
Slug string `json:"slug"`
|
|
State *string `json:"state"`
|
|
Type string `json:"type"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
Version int `json:"version"`
|
|
}
|
|
|
|
// EntityCreate defines model for EntityCreate.
|
|
type EntityCreate struct {
|
|
// Attributes Validated against the type's attribute_schema
|
|
Attributes *map[string]interface{} `json:"attributes,omitempty"`
|
|
Name string `json:"name"`
|
|
Slug string `json:"slug"`
|
|
|
|
// State Defaults to the lifecycle's default_state
|
|
State *string `json:"state,omitempty"`
|
|
|
|
// Type Must be a non-abstract entity type
|
|
Type string `json:"type"`
|
|
}
|
|
|
|
// EntityPatch At least one of the fields must be present.
|
|
type EntityPatch struct {
|
|
// Attributes Merged; validated against attribute_schema
|
|
Attributes *map[string]interface{} `json:"attributes,omitempty"`
|
|
MaintenanceUntil *time.Time `json:"maintenance_until"`
|
|
Name *string `json:"name,omitempty"`
|
|
|
|
// State Target lifecycle state (transition validated)
|
|
State *string `json:"state,omitempty"`
|
|
}
|
|
|
|
// EntityType defines model for EntityType.
|
|
type EntityType struct {
|
|
// AttributeSchema JSON Schema
|
|
AttributeSchema *map[string]interface{} `json:"attribute_schema"`
|
|
Description *string `json:"description,omitempty"`
|
|
Domain string `json:"domain"`
|
|
IsAbstract bool `json:"is_abstract"`
|
|
Layer EntityTypeLayer `json:"layer"`
|
|
LifecycleId *string `json:"lifecycle_id"`
|
|
Name string `json:"name"`
|
|
ParentType *string `json:"parent_type"`
|
|
SchemaVersion *int `json:"schema_version,omitempty"`
|
|
Status EntityTypeStatus `json:"status"`
|
|
Version *int `json:"version,omitempty"`
|
|
}
|
|
|
|
// EntityTypeLayer defines model for EntityType.Layer.
|
|
type EntityTypeLayer string
|
|
|
|
// EntityTypeStatus defines model for EntityType.Status.
|
|
type EntityTypeStatus string
|
|
|
|
// EntityTypeCreate defines model for EntityTypeCreate.
|
|
type EntityTypeCreate struct {
|
|
AttributeSchema *map[string]interface{} `json:"attribute_schema,omitempty"`
|
|
Description *string `json:"description,omitempty"`
|
|
Domain string `json:"domain"`
|
|
IsAbstract *bool `json:"is_abstract,omitempty"`
|
|
Layer EntityTypeCreateLayer `json:"layer"`
|
|
LifecycleId *string `json:"lifecycle_id,omitempty"`
|
|
Name string `json:"name"`
|
|
ParentType *string `json:"parent_type,omitempty"`
|
|
}
|
|
|
|
// EntityTypeCreateLayer defines model for EntityTypeCreate.Layer.
|
|
type EntityTypeCreateLayer string
|
|
|
|
// EntityTypePatch defines model for EntityTypePatch.
|
|
type EntityTypePatch struct {
|
|
AttributeSchema *map[string]interface{} `json:"attribute_schema,omitempty"`
|
|
Description *string `json:"description,omitempty"`
|
|
Status *EntityTypePatchStatus `json:"status,omitempty"`
|
|
}
|
|
|
|
// EntityTypePatchStatus defines model for EntityTypePatch.Status.
|
|
type EntityTypePatchStatus string
|
|
|
|
// Event defines model for Event.
|
|
type Event struct {
|
|
CorrelationId *string `json:"correlation_id"`
|
|
Data *map[string]interface{} `json:"data,omitempty"`
|
|
EntityId *string `json:"entity_id"`
|
|
Id int `json:"id"`
|
|
Severity EventSeverity `json:"severity"`
|
|
Source string `json:"source"`
|
|
Ts time.Time `json:"ts"`
|
|
Type string `json:"type"`
|
|
}
|
|
|
|
// EventSeverity defines model for Event.Severity.
|
|
type EventSeverity string
|
|
|
|
// Execution defines model for Execution.
|
|
type Execution struct {
|
|
Action string `json:"action"`
|
|
AgentId *string `json:"agent_id"`
|
|
ApprovalId *string `json:"approval_id"`
|
|
ClassificationId *string `json:"classification_id"`
|
|
CompletedAt *time.Time `json:"completed_at"`
|
|
CorrelationId string `json:"correlation_id"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
DurationMs *int `json:"duration_ms"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
|
|
// Params Skill params (validated against params_schema)
|
|
Params *map[string]interface{} `json:"params,omitempty"`
|
|
Result *map[string]interface{} `json:"result"`
|
|
RiskClass string `json:"risk_class"`
|
|
SignalId *string `json:"signal_id"`
|
|
SkillId *string `json:"skill_id"`
|
|
SkillVersion *int `json:"skill_version"`
|
|
Slug string `json:"slug"`
|
|
StartedAt *time.Time `json:"started_at"`
|
|
Status ExecutionStatus `json:"status"`
|
|
Target *string `json:"target"`
|
|
Verified *bool `json:"verified,omitempty"`
|
|
}
|
|
|
|
// ExecutionStatus defines model for Execution.Status.
|
|
type ExecutionStatus string
|
|
|
|
// ExecutionRequest defines model for ExecutionRequest.
|
|
type ExecutionRequest struct {
|
|
Action string `json:"action"`
|
|
Params *map[string]interface{} `json:"params,omitempty"`
|
|
Reason *string `json:"reason,omitempty"`
|
|
|
|
// SignalId Signal that motivated this (optional)
|
|
SignalId *string `json:"signal_id,omitempty"`
|
|
|
|
// Target Entity UUID or slug
|
|
Target string `json:"target"`
|
|
}
|
|
|
|
// GraphView defines model for GraphView.
|
|
type GraphView struct {
|
|
Edges []Relationship `json:"edges"`
|
|
Nodes []Entity `json:"nodes"`
|
|
|
|
// Truncated True if node cap was hit
|
|
Truncated *bool `json:"truncated,omitempty"`
|
|
}
|
|
|
|
// HealthSummary defines model for HealthSummary.
|
|
type HealthSummary struct {
|
|
Entities []struct {
|
|
Health HealthSummaryEntitiesHealth `json:"health"`
|
|
LastCheckAt *time.Time `json:"last_check_at"`
|
|
Slug string `json:"slug"`
|
|
Trend *HealthSummaryEntitiesTrend `json:"trend"`
|
|
Type string `json:"type"`
|
|
} `json:"entities"`
|
|
Summary struct {
|
|
Degraded int `json:"degraded"`
|
|
Down int `json:"down"`
|
|
Healthy int `json:"healthy"`
|
|
Unknown int `json:"unknown"`
|
|
} `json:"summary"`
|
|
}
|
|
|
|
// HealthSummaryEntitiesHealth defines model for HealthSummary.Entities.Health.
|
|
type HealthSummaryEntitiesHealth string
|
|
|
|
// HealthSummaryEntitiesTrend defines model for HealthSummary.Entities.Trend.
|
|
type HealthSummaryEntitiesTrend string
|
|
|
|
// KnowledgeHit defines model for KnowledgeHit.
|
|
type KnowledgeHit struct {
|
|
Id openapi_types.UUID `json:"id"`
|
|
LinkedEntities *[]string `json:"linked_entities,omitempty"`
|
|
Rank *float32 `json:"rank"`
|
|
Slug string `json:"slug"`
|
|
|
|
// Snippet Highlighted match context
|
|
Snippet *string `json:"snippet"`
|
|
SourcePath *string `json:"source_path"`
|
|
Title string `json:"title"`
|
|
Type KnowledgeHitType `json:"type"`
|
|
}
|
|
|
|
// KnowledgeHitType defines model for KnowledgeHit.Type.
|
|
type KnowledgeHitType string
|
|
|
|
// LifecycleDef defines model for LifecycleDef.
|
|
type LifecycleDef struct {
|
|
DefaultState string `json:"default_state"`
|
|
Id string `json:"id"`
|
|
States []string `json:"states"`
|
|
TerminalStates *[]string `json:"terminal_states,omitempty"`
|
|
|
|
// Transitions {from: {to: {requires: [named-check, ...]}}}
|
|
Transitions map[string]interface{} `json:"transitions"`
|
|
}
|
|
|
|
// MetricSeries defines model for MetricSeries.
|
|
type MetricSeries struct {
|
|
EntityId string `json:"entity_id"`
|
|
Metric string `json:"metric"`
|
|
Rollup MetricSeriesRollup `json:"rollup"`
|
|
Samples []struct {
|
|
Avg *float32 `json:"avg"`
|
|
Count *int `json:"count"`
|
|
Max *float32 `json:"max"`
|
|
Min *float32 `json:"min"`
|
|
Ts time.Time `json:"ts"`
|
|
|
|
// Value Raw sample value
|
|
Value *float32 `json:"value"`
|
|
} `json:"samples"`
|
|
Trend *Trend `json:"trend,omitempty"`
|
|
}
|
|
|
|
// MetricSeriesRollup defines model for MetricSeries.Rollup.
|
|
type MetricSeriesRollup string
|
|
|
|
// Pattern defines model for Pattern.
|
|
type Pattern struct {
|
|
Action string `json:"action"`
|
|
AppliesType string `json:"applies_type"`
|
|
|
|
// Confidence Wilson lower bound, capped by evidence_count/5
|
|
Confidence float32 `json:"confidence"`
|
|
EvidenceCount int `json:"evidence_count"`
|
|
FailureCount *int `json:"failure_count,omitempty"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
LastValidatedAt *time.Time `json:"last_validated_at"`
|
|
Pattern string `json:"pattern"`
|
|
Quarantined *bool `json:"quarantined,omitempty"`
|
|
Slug string `json:"slug"`
|
|
Status PatternStatus `json:"status"`
|
|
SuccessCount *int `json:"success_count,omitempty"`
|
|
Version int `json:"version"`
|
|
}
|
|
|
|
// PatternStatus defines model for Pattern.Status.
|
|
type PatternStatus string
|
|
|
|
// Problem defines model for Problem.
|
|
type Problem struct {
|
|
Detail *string `json:"detail,omitempty"`
|
|
|
|
// Errors Field-level validation errors (422)
|
|
Errors *[]struct {
|
|
Field string `json:"field"`
|
|
Reason string `json:"reason"`
|
|
} `json:"errors,omitempty"`
|
|
Instance *string `json:"instance,omitempty"`
|
|
Status int `json:"status"`
|
|
Title string `json:"title"`
|
|
Type *string `json:"type,omitempty"`
|
|
}
|
|
|
|
// Relationship defines model for Relationship.
|
|
type Relationship struct {
|
|
Attributes *map[string]interface{} `json:"attributes"`
|
|
|
|
// Source Slug of source entity
|
|
Source string `json:"source"`
|
|
|
|
// Target Slug of target entity
|
|
Target string `json:"target"`
|
|
Type string `json:"type"`
|
|
ValidFrom time.Time `json:"valid_from"`
|
|
ValidTo *time.Time `json:"valid_to"`
|
|
}
|
|
|
|
// RelationshipCreate defines model for RelationshipCreate.
|
|
type RelationshipCreate struct {
|
|
Attributes *map[string]interface{} `json:"attributes,omitempty"`
|
|
|
|
// Source UUID or slug
|
|
Source string `json:"source"`
|
|
|
|
// Target UUID or slug
|
|
Target string `json:"target"`
|
|
Type string `json:"type"`
|
|
}
|
|
|
|
// RelationshipType defines model for RelationshipType.
|
|
type RelationshipType struct {
|
|
Cardinality RelationshipTypeCardinality `json:"cardinality"`
|
|
Description *string `json:"description,omitempty"`
|
|
Inverse *string `json:"inverse"`
|
|
Name string `json:"name"`
|
|
|
|
// SourceType May be abstract
|
|
SourceType string `json:"source_type"`
|
|
|
|
// TargetType May be abstract
|
|
TargetType string `json:"target_type"`
|
|
}
|
|
|
|
// RelationshipTypeCardinality defines model for RelationshipType.Cardinality.
|
|
type RelationshipTypeCardinality string
|
|
|
|
// RiskClass defines model for RiskClass.
|
|
type RiskClass struct {
|
|
ApprovalRequired RiskClassApprovalRequired `json:"approval_required"`
|
|
AutonomyAllowed bool `json:"autonomy_allowed"`
|
|
Description *string `json:"description,omitempty"`
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
// RiskClassApprovalRequired defines model for RiskClass.ApprovalRequired.
|
|
type RiskClassApprovalRequired string
|
|
|
|
// Signal defines model for Signal.
|
|
type Signal struct {
|
|
CheckId *string `json:"check_id"`
|
|
Evidence *string `json:"evidence"`
|
|
FirstSeenAt time.Time `json:"first_seen_at"`
|
|
FlapCount *int `json:"flap_count,omitempty"`
|
|
HoldDownUntil *time.Time `json:"hold_down_until"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
Kind string `json:"kind"`
|
|
LastSeenAt time.Time `json:"last_seen_at"`
|
|
LikelyCause *string `json:"likely_cause"`
|
|
MuteUntil *time.Time `json:"mute_until"`
|
|
OccurrenceCount int `json:"occurrence_count"`
|
|
Severity SignalSeverity `json:"severity"`
|
|
Slug string `json:"slug"`
|
|
State SignalState `json:"state"`
|
|
|
|
// Target Slug of the entity this concerns
|
|
Target *string `json:"target"`
|
|
}
|
|
|
|
// SignalSeverity defines model for Signal.Severity.
|
|
type SignalSeverity string
|
|
|
|
// SignalState defines model for Signal.State.
|
|
type SignalState string
|
|
|
|
// Skill defines model for Skill.
|
|
type Skill struct {
|
|
Action string `json:"action"`
|
|
AppliesType *string `json:"applies_type"`
|
|
ChangeReason *string `json:"change_reason"`
|
|
ChangedBy *string `json:"changed_by"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
LastUsedAt *time.Time `json:"last_used_at"`
|
|
Name string `json:"name"`
|
|
PatternIds *[]string `json:"pattern_ids,omitempty"`
|
|
|
|
// Procedure Structured steps/verify/rollback/params (plan R3-9)
|
|
Procedure struct {
|
|
ExpectedDurationS *int `json:"expected_duration_s,omitempty"`
|
|
KnownFailureModes *[]string `json:"known_failure_modes,omitempty"`
|
|
ParamsSchema *map[string]interface{} `json:"params_schema,omitempty"`
|
|
Rollback *[]SkillStep `json:"rollback,omitempty"`
|
|
Steps []SkillStep `json:"steps"`
|
|
Verify []SkillStep `json:"verify"`
|
|
} `json:"procedure"`
|
|
Slug string `json:"slug"`
|
|
Status SkillStatus `json:"status"`
|
|
SuccessRate *float32 `json:"success_rate"`
|
|
Version int `json:"version"`
|
|
}
|
|
|
|
// SkillStatus defines model for Skill.Status.
|
|
type SkillStatus string
|
|
|
|
// SkillStep defines model for SkillStep.
|
|
type SkillStep struct {
|
|
// Command Go template over params
|
|
Command string `json:"command"`
|
|
Expect *struct {
|
|
ExitCode *int `json:"exit_code,omitempty"`
|
|
StdoutContains *string `json:"stdout_contains,omitempty"`
|
|
} `json:"expect,omitempty"`
|
|
Name *string `json:"name,omitempty"`
|
|
Retry *struct {
|
|
Attempts *int `json:"attempts,omitempty"`
|
|
DelayS *int `json:"delay_s,omitempty"`
|
|
} `json:"retry,omitempty"`
|
|
Runner SkillStepRunner `json:"runner"`
|
|
|
|
// Target Go template over params
|
|
Target *string `json:"target,omitempty"`
|
|
TimeoutS *int `json:"timeout_s,omitempty"`
|
|
}
|
|
|
|
// SkillStepRunner defines model for SkillStep.Runner.
|
|
type SkillStepRunner string
|
|
|
|
// Trend defines model for Trend.
|
|
type Trend struct {
|
|
Anomaly *bool `json:"anomaly,omitempty"`
|
|
Direction TrendDirection `json:"direction"`
|
|
|
|
// Forecast Simple linear projection, 7d out
|
|
Forecast *float32 `json:"forecast"`
|
|
Metric string `json:"metric"`
|
|
|
|
// Slope Linear fit per day
|
|
Slope *float32 `json:"slope"`
|
|
}
|
|
|
|
// TrendDirection defines model for Trend.Direction.
|
|
type TrendDirection string
|
|
|
|
// Cursor defines model for Cursor.
|
|
type Cursor = string
|
|
|
|
// EntityId defines model for EntityId.
|
|
type EntityId = string
|
|
|
|
// FromTime defines model for FromTime.
|
|
type FromTime = time.Time
|
|
|
|
// IdempotencyKey defines model for IdempotencyKey.
|
|
type IdempotencyKey = string
|
|
|
|
// IfMatch defines model for IfMatch.
|
|
type IfMatch = string
|
|
|
|
// Limit defines model for Limit.
|
|
type Limit = int
|
|
|
|
// ToTime defines model for ToTime.
|
|
type ToTime = time.Time
|
|
|
|
// PendingApproval defines model for PendingApproval.
|
|
type PendingApproval = Approval
|
|
|
|
// SignalUpdated defines model for SignalUpdated.
|
|
type SignalUpdated = Signal
|
|
|
|
// QueryAgentActivityParams defines parameters for QueryAgentActivity.
|
|
type QueryAgentActivityParams struct {
|
|
AgentId *string `form:"agent_id,omitempty" json:"agent_id,omitempty"`
|
|
ActivityType *string `form:"activity_type,omitempty" json:"activity_type,omitempty"`
|
|
EntityId *string `form:"entity_id,omitempty" json:"entity_id,omitempty"`
|
|
From *FromTime `form:"from,omitempty" json:"from,omitempty"`
|
|
To *ToTime `form:"to,omitempty" json:"to,omitempty"`
|
|
|
|
// Cursor Opaque cursor from a previous response's next_cursor
|
|
Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
|
|
Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
|
|
}
|
|
|
|
// ListApprovalsParams defines parameters for ListApprovals.
|
|
type ListApprovalsParams struct {
|
|
Status *ListApprovalsParamsStatus `form:"status,omitempty" json:"status,omitempty"`
|
|
Kind *ListApprovalsParamsKind `form:"kind,omitempty" json:"kind,omitempty"`
|
|
|
|
// Cursor Opaque cursor from a previous response's next_cursor
|
|
Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
|
|
Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
|
|
}
|
|
|
|
// ListApprovalsParamsStatus defines parameters for ListApprovals.
|
|
type ListApprovalsParamsStatus string
|
|
|
|
// ListApprovalsParamsKind defines parameters for ListApprovals.
|
|
type ListApprovalsParamsKind string
|
|
|
|
// DecideApprovalJSONBody defines parameters for DecideApproval.
|
|
type DecideApprovalJSONBody struct {
|
|
Decision DecideApprovalJSONBodyDecision `json:"decision"`
|
|
Note *string `json:"note,omitempty"`
|
|
}
|
|
|
|
// DecideApprovalParams defines parameters for DecideApproval.
|
|
type DecideApprovalParams struct {
|
|
// IdempotencyKey Client-generated key; replays within 24h return the original response
|
|
IdempotencyKey *IdempotencyKey `json:"Idempotency-Key,omitempty"`
|
|
}
|
|
|
|
// DecideApprovalJSONBodyDecision defines parameters for DecideApproval.
|
|
type DecideApprovalJSONBodyDecision string
|
|
|
|
// QueryAuditParams defines parameters for QueryAudit.
|
|
type QueryAuditParams struct {
|
|
ActorType *string `form:"actor_type,omitempty" json:"actor_type,omitempty"`
|
|
ActorId *string `form:"actor_id,omitempty" json:"actor_id,omitempty"`
|
|
EntityId *string `form:"entity_id,omitempty" json:"entity_id,omitempty"`
|
|
Action *string `form:"action,omitempty" json:"action,omitempty"`
|
|
CorrelationId *string `form:"correlation_id,omitempty" json:"correlation_id,omitempty"`
|
|
From *FromTime `form:"from,omitempty" json:"from,omitempty"`
|
|
To *ToTime `form:"to,omitempty" json:"to,omitempty"`
|
|
|
|
// Cursor Opaque cursor from a previous response's next_cursor
|
|
Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
|
|
Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
|
|
}
|
|
|
|
// ListChecksParams defines parameters for ListChecks.
|
|
type ListChecksParams struct {
|
|
Kind *string `form:"kind,omitempty" json:"kind,omitempty"`
|
|
Target *string `form:"target,omitempty" json:"target,omitempty"`
|
|
Enabled *bool `form:"enabled,omitempty" json:"enabled,omitempty"`
|
|
|
|
// Cursor Opaque cursor from a previous response's next_cursor
|
|
Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
|
|
Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
|
|
}
|
|
|
|
// CreateCheckParams defines parameters for CreateCheck.
|
|
type CreateCheckParams struct {
|
|
// IdempotencyKey Client-generated key; replays within 24h return the original response
|
|
IdempotencyKey *IdempotencyKey `json:"Idempotency-Key,omitempty"`
|
|
}
|
|
|
|
// PatchCheckParams defines parameters for PatchCheck.
|
|
type PatchCheckParams struct {
|
|
// IfMatch ETag from a prior GET; 412 on version mismatch
|
|
IfMatch IfMatch `json:"If-Match"`
|
|
}
|
|
|
|
// ListClassificationsParams defines parameters for ListClassifications.
|
|
type ListClassificationsParams struct {
|
|
SignalId *string `form:"signal_id,omitempty" json:"signal_id,omitempty"`
|
|
EntityId *string `form:"entity_id,omitempty" json:"entity_id,omitempty"`
|
|
Route *ListClassificationsParamsRoute `form:"route,omitempty" json:"route,omitempty"`
|
|
|
|
// Cursor Opaque cursor from a previous response's next_cursor
|
|
Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
|
|
Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
|
|
}
|
|
|
|
// ListClassificationsParamsRoute defines parameters for ListClassifications.
|
|
type ListClassificationsParamsRoute string
|
|
|
|
// ListEntitiesParams defines parameters for ListEntities.
|
|
type ListEntitiesParams struct {
|
|
// Type Filter by entity type (includes descendants)
|
|
Type *string `form:"type,omitempty" json:"type,omitempty"`
|
|
State *string `form:"state,omitempty" json:"state,omitempty"`
|
|
Domain *string `form:"domain,omitempty" json:"domain,omitempty"`
|
|
Layer *string `form:"layer,omitempty" json:"layer,omitempty"`
|
|
|
|
// Q Substring match on slug/name
|
|
Q *string `form:"q,omitempty" json:"q,omitempty"`
|
|
|
|
// Cursor Opaque cursor from a previous response's next_cursor
|
|
Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
|
|
Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
|
|
}
|
|
|
|
// CreateEntityParams defines parameters for CreateEntity.
|
|
type CreateEntityParams struct {
|
|
// IdempotencyKey Client-generated key; replays within 24h return the original response
|
|
IdempotencyKey *IdempotencyKey `json:"Idempotency-Key,omitempty"`
|
|
}
|
|
|
|
// PatchEntityParams defines parameters for PatchEntity.
|
|
type PatchEntityParams struct {
|
|
// IfMatch ETag from a prior GET; 412 on version mismatch
|
|
IfMatch IfMatch `json:"If-Match"`
|
|
}
|
|
|
|
// GetBlastRadiusParams defines parameters for GetBlastRadius.
|
|
type GetBlastRadiusParams struct {
|
|
Depth *int `form:"depth,omitempty" json:"depth,omitempty"`
|
|
}
|
|
|
|
// GetEntityRelationsParams defines parameters for GetEntityRelations.
|
|
type GetEntityRelationsParams struct {
|
|
RelType *string `form:"rel_type,omitempty" json:"rel_type,omitempty"`
|
|
Direction *GetEntityRelationsParamsDirection `form:"direction,omitempty" json:"direction,omitempty"`
|
|
}
|
|
|
|
// GetEntityRelationsParamsDirection defines parameters for GetEntityRelations.
|
|
type GetEntityRelationsParamsDirection string
|
|
|
|
// QueryEventsParams defines parameters for QueryEvents.
|
|
type QueryEventsParams struct {
|
|
Type *string `form:"type,omitempty" json:"type,omitempty"`
|
|
EntityId *string `form:"entity_id,omitempty" json:"entity_id,omitempty"`
|
|
Severity *string `form:"severity,omitempty" json:"severity,omitempty"`
|
|
CorrelationId *string `form:"correlation_id,omitempty" json:"correlation_id,omitempty"`
|
|
From *FromTime `form:"from,omitempty" json:"from,omitempty"`
|
|
To *ToTime `form:"to,omitempty" json:"to,omitempty"`
|
|
|
|
// Cursor Opaque cursor from a previous response's next_cursor
|
|
Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
|
|
Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
|
|
}
|
|
|
|
// StreamEventsParams defines parameters for StreamEvents.
|
|
type StreamEventsParams struct {
|
|
// Type Filter by event type prefix
|
|
Type *string `form:"type,omitempty" json:"type,omitempty"`
|
|
LastEventID *string `json:"Last-Event-ID,omitempty"`
|
|
}
|
|
|
|
// ListExecutionsParams defines parameters for ListExecutions.
|
|
type ListExecutionsParams struct {
|
|
Status *string `form:"status,omitempty" json:"status,omitempty"`
|
|
Target *string `form:"target,omitempty" json:"target,omitempty"`
|
|
Action *string `form:"action,omitempty" json:"action,omitempty"`
|
|
CorrelationId *string `form:"correlation_id,omitempty" json:"correlation_id,omitempty"`
|
|
|
|
// Cursor Opaque cursor from a previous response's next_cursor
|
|
Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
|
|
Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
|
|
}
|
|
|
|
// RequestExecutionParams defines parameters for RequestExecution.
|
|
type RequestExecutionParams struct {
|
|
// IdempotencyKey Client-generated key; replays within 24h return the original response
|
|
IdempotencyKey *IdempotencyKey `json:"Idempotency-Key,omitempty"`
|
|
}
|
|
|
|
// GetGraphParams defines parameters for GetGraph.
|
|
type GetGraphParams struct {
|
|
// Root Start entity (UUID or slug); omit for whole graph (capped)
|
|
Root *string `form:"root,omitempty" json:"root,omitempty"`
|
|
Depth *int `form:"depth,omitempty" json:"depth,omitempty"`
|
|
RelType *[]string `form:"rel_type,omitempty" json:"rel_type,omitempty"`
|
|
}
|
|
|
|
// SearchKnowledgeParams defines parameters for SearchKnowledge.
|
|
type SearchKnowledgeParams struct {
|
|
Q string `form:"q" json:"q"`
|
|
Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
|
|
}
|
|
|
|
// QueryMetricsParams defines parameters for QueryMetrics.
|
|
type QueryMetricsParams struct {
|
|
EntityId *string `form:"entity_id,omitempty" json:"entity_id,omitempty"`
|
|
Metric *[]string `form:"metric,omitempty" json:"metric,omitempty"`
|
|
Rollup *QueryMetricsParamsRollup `form:"rollup,omitempty" json:"rollup,omitempty"`
|
|
From *FromTime `form:"from,omitempty" json:"from,omitempty"`
|
|
To *ToTime `form:"to,omitempty" json:"to,omitempty"`
|
|
}
|
|
|
|
// QueryMetricsParamsRollup defines parameters for QueryMetrics.
|
|
type QueryMetricsParamsRollup string
|
|
|
|
// CreateEntityTypeParams defines parameters for CreateEntityType.
|
|
type CreateEntityTypeParams struct {
|
|
// IdempotencyKey Client-generated key; replays within 24h return the original response
|
|
IdempotencyKey *IdempotencyKey `json:"Idempotency-Key,omitempty"`
|
|
}
|
|
|
|
// PatchEntityTypeParams defines parameters for PatchEntityType.
|
|
type PatchEntityTypeParams struct {
|
|
// IfMatch ETag from a prior GET; 412 on version mismatch
|
|
IfMatch IfMatch `json:"If-Match"`
|
|
}
|
|
|
|
// ListPatternsParams defines parameters for ListPatterns.
|
|
type ListPatternsParams struct {
|
|
EntityType *string `form:"entity_type,omitempty" json:"entity_type,omitempty"`
|
|
Action *string `form:"action,omitempty" json:"action,omitempty"`
|
|
Status *string `form:"status,omitempty" json:"status,omitempty"`
|
|
|
|
// Cursor Opaque cursor from a previous response's next_cursor
|
|
Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
|
|
Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
|
|
}
|
|
|
|
// PatchPatternJSONBody defines parameters for PatchPattern.
|
|
type PatchPatternJSONBody struct {
|
|
Note *string `json:"note,omitempty"`
|
|
Quarantined *bool `json:"quarantined,omitempty"`
|
|
Status *PatchPatternJSONBodyStatus `json:"status,omitempty"`
|
|
}
|
|
|
|
// PatchPatternParams defines parameters for PatchPattern.
|
|
type PatchPatternParams struct {
|
|
// IfMatch ETag from a prior GET; 412 on version mismatch
|
|
IfMatch IfMatch `json:"If-Match"`
|
|
}
|
|
|
|
// PatchPatternJSONBodyStatus defines parameters for PatchPattern.
|
|
type PatchPatternJSONBodyStatus string
|
|
|
|
// CreateApprovalRuleParams defines parameters for CreateApprovalRule.
|
|
type CreateApprovalRuleParams struct {
|
|
// IdempotencyKey Client-generated key; replays within 24h return the original response
|
|
IdempotencyKey *IdempotencyKey `json:"Idempotency-Key,omitempty"`
|
|
}
|
|
|
|
// PatchApprovalRuleParams defines parameters for PatchApprovalRule.
|
|
type PatchApprovalRuleParams struct {
|
|
// IfMatch ETag from a prior GET; 412 on version mismatch
|
|
IfMatch IfMatch `json:"If-Match"`
|
|
}
|
|
|
|
// PatchAutonomySettingsJSONBody defines parameters for PatchAutonomySettings.
|
|
type PatchAutonomySettingsJSONBody map[string]string
|
|
|
|
// EndRelationshipParams defines parameters for EndRelationship.
|
|
type EndRelationshipParams struct {
|
|
Source string `form:"source" json:"source"`
|
|
Target string `form:"target" json:"target"`
|
|
RelType string `form:"rel_type" json:"rel_type"`
|
|
}
|
|
|
|
// CreateRelationshipParams defines parameters for CreateRelationship.
|
|
type CreateRelationshipParams struct {
|
|
// IdempotencyKey Client-generated key; replays within 24h return the original response
|
|
IdempotencyKey *IdempotencyKey `json:"Idempotency-Key,omitempty"`
|
|
}
|
|
|
|
// ListSignalsParams defines parameters for ListSignals.
|
|
type ListSignalsParams struct {
|
|
State *string `form:"state,omitempty" json:"state,omitempty"`
|
|
Severity *ListSignalsParamsSeverity `form:"severity,omitempty" json:"severity,omitempty"`
|
|
EntityId *string `form:"entity_id,omitempty" json:"entity_id,omitempty"`
|
|
Kind *string `form:"kind,omitempty" json:"kind,omitempty"`
|
|
|
|
// Cursor Opaque cursor from a previous response's next_cursor
|
|
Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
|
|
Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
|
|
}
|
|
|
|
// ListSignalsParamsSeverity defines parameters for ListSignals.
|
|
type ListSignalsParamsSeverity string
|
|
|
|
// MuteSignalJSONBody defines parameters for MuteSignal.
|
|
type MuteSignalJSONBody struct {
|
|
MuteUntil time.Time `json:"mute_until"`
|
|
Note *string `json:"note,omitempty"`
|
|
}
|
|
|
|
// ResolveSignalJSONBody defines parameters for ResolveSignal.
|
|
type ResolveSignalJSONBody struct {
|
|
Note *string `json:"note,omitempty"`
|
|
}
|
|
|
|
// ListSkillsParams defines parameters for ListSkills.
|
|
type ListSkillsParams struct {
|
|
AppliesTo *string `form:"applies_to,omitempty" json:"applies_to,omitempty"`
|
|
Action *string `form:"action,omitempty" json:"action,omitempty"`
|
|
Status *string `form:"status,omitempty" json:"status,omitempty"`
|
|
|
|
// Cursor Opaque cursor from a previous response's next_cursor
|
|
Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
|
|
Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
|
|
}
|
|
|
|
// PatchSkillJSONBody defines parameters for PatchSkill.
|
|
type PatchSkillJSONBody struct {
|
|
Note *string `json:"note,omitempty"`
|
|
PinnedVersion *int `json:"pinned_version,omitempty"`
|
|
Status *PatchSkillJSONBodyStatus `json:"status,omitempty"`
|
|
}
|
|
|
|
// PatchSkillParams defines parameters for PatchSkill.
|
|
type PatchSkillParams struct {
|
|
// IfMatch ETag from a prior GET; 412 on version mismatch
|
|
IfMatch IfMatch `json:"If-Match"`
|
|
}
|
|
|
|
// PatchSkillJSONBodyStatus defines parameters for PatchSkill.
|
|
type PatchSkillJSONBodyStatus string
|
|
|
|
// GetTrendsParams defines parameters for GetTrends.
|
|
type GetTrendsParams struct {
|
|
From *FromTime `form:"from,omitempty" json:"from,omitempty"`
|
|
To *ToTime `form:"to,omitempty" json:"to,omitempty"`
|
|
}
|
|
|
|
// DecideApprovalJSONRequestBody defines body for DecideApproval for application/json ContentType.
|
|
type DecideApprovalJSONRequestBody DecideApprovalJSONBody
|
|
|
|
// CreateCheckJSONRequestBody defines body for CreateCheck for application/json ContentType.
|
|
type CreateCheckJSONRequestBody = CheckCreate
|
|
|
|
// PatchCheckJSONRequestBody defines body for PatchCheck for application/json ContentType.
|
|
type PatchCheckJSONRequestBody = CheckPatch
|
|
|
|
// CreateEntityJSONRequestBody defines body for CreateEntity for application/json ContentType.
|
|
type CreateEntityJSONRequestBody = EntityCreate
|
|
|
|
// PatchEntityJSONRequestBody defines body for PatchEntity for application/json ContentType.
|
|
type PatchEntityJSONRequestBody = EntityPatch
|
|
|
|
// RequestExecutionJSONRequestBody defines body for RequestExecution for application/json ContentType.
|
|
type RequestExecutionJSONRequestBody = ExecutionRequest
|
|
|
|
// CreateEntityTypeJSONRequestBody defines body for CreateEntityType for application/json ContentType.
|
|
type CreateEntityTypeJSONRequestBody = EntityTypeCreate
|
|
|
|
// PatchEntityTypeJSONRequestBody defines body for PatchEntityType for application/json ContentType.
|
|
type PatchEntityTypeJSONRequestBody = EntityTypePatch
|
|
|
|
// PatchPatternJSONRequestBody defines body for PatchPattern for application/json ContentType.
|
|
type PatchPatternJSONRequestBody PatchPatternJSONBody
|
|
|
|
// CreateApprovalRuleJSONRequestBody defines body for CreateApprovalRule for application/json ContentType.
|
|
type CreateApprovalRuleJSONRequestBody = ApprovalRuleCreate
|
|
|
|
// PatchApprovalRuleJSONRequestBody defines body for PatchApprovalRule for application/json ContentType.
|
|
type PatchApprovalRuleJSONRequestBody = ApprovalRuleCreate
|
|
|
|
// PatchAutonomySettingsJSONRequestBody defines body for PatchAutonomySettings for application/json ContentType.
|
|
type PatchAutonomySettingsJSONRequestBody PatchAutonomySettingsJSONBody
|
|
|
|
// CreateRelationshipJSONRequestBody defines body for CreateRelationship for application/json ContentType.
|
|
type CreateRelationshipJSONRequestBody = RelationshipCreate
|
|
|
|
// MuteSignalJSONRequestBody defines body for MuteSignal for application/json ContentType.
|
|
type MuteSignalJSONRequestBody MuteSignalJSONBody
|
|
|
|
// ResolveSignalJSONRequestBody defines body for ResolveSignal for application/json ContentType.
|
|
type ResolveSignalJSONRequestBody ResolveSignalJSONBody
|
|
|
|
// PatchSkillJSONRequestBody defines body for PatchSkill for application/json ContentType.
|
|
type PatchSkillJSONRequestBody PatchSkillJSONBody
|
|
|
|
// ServerInterface represents all server handlers.
|
|
type ServerInterface interface {
|
|
// Agent behavior log
|
|
// (GET /agent-activity)
|
|
QueryAgentActivity(w http.ResponseWriter, r *http.Request, params QueryAgentActivityParams)
|
|
// List approvals
|
|
// (GET /approvals)
|
|
ListApprovals(w http.ResponseWriter, r *http.Request, params ListApprovalsParams)
|
|
// Approve or deny (single-use token verified server-side)
|
|
// (POST /approvals/{id}/decision)
|
|
DecideApproval(w http.ResponseWriter, r *http.Request, id EntityId, params DecideApprovalParams)
|
|
// Audit log
|
|
// (GET /audit)
|
|
QueryAudit(w http.ResponseWriter, r *http.Request, params QueryAuditParams)
|
|
// List check definitions
|
|
// (GET /checks)
|
|
ListChecks(w http.ResponseWriter, r *http.Request, params ListChecksParams)
|
|
// Create a check (checks-as-data, plan R3-7)
|
|
// (POST /checks)
|
|
CreateCheck(w http.ResponseWriter, r *http.Request, params CreateCheckParams)
|
|
// Update or disable a check
|
|
// (PATCH /checks/{id})
|
|
PatchCheck(w http.ResponseWriter, r *http.Request, id EntityId, params PatchCheckParams)
|
|
// Classifier decisions (the autonomous-decision audit trail)
|
|
// (GET /classifications)
|
|
ListClassifications(w http.ResponseWriter, r *http.Request, params ListClassificationsParams)
|
|
// List entities
|
|
// (GET /entities)
|
|
ListEntities(w http.ResponseWriter, r *http.Request, params ListEntitiesParams)
|
|
// Create an entity
|
|
// (POST /entities)
|
|
CreateEntity(w http.ResponseWriter, r *http.Request, params CreateEntityParams)
|
|
// Get entity by UUID or slug
|
|
// (GET /entities/{id})
|
|
GetEntity(w http.ResponseWriter, r *http.Request, id EntityId)
|
|
// Update attributes or transition lifecycle state
|
|
// (PATCH /entities/{id})
|
|
PatchEntity(w http.ResponseWriter, r *http.Request, id EntityId, params PatchEntityParams)
|
|
// Entities affected if this entity fails
|
|
// (GET /entities/{id}/blast-radius)
|
|
GetBlastRadius(w http.ResponseWriter, r *http.Request, id EntityId, params GetBlastRadiusParams)
|
|
// Direct relationships of an entity (both directions)
|
|
// (GET /entities/{id}/relations)
|
|
GetEntityRelations(w http.ResponseWriter, r *http.Request, id EntityId, params GetEntityRelationsParams)
|
|
// Historical events
|
|
// (GET /events)
|
|
QueryEvents(w http.ResponseWriter, r *http.Request, params QueryEventsParams)
|
|
// Live event stream (SSE)
|
|
// (GET /events/stream)
|
|
StreamEvents(w http.ResponseWriter, r *http.Request, params StreamEventsParams)
|
|
// List executions
|
|
// (GET /executions)
|
|
ListExecutions(w http.ResponseWriter, r *http.Request, params ListExecutionsParams)
|
|
// Request an execution (classify → approval check → enqueue)
|
|
// (POST /executions)
|
|
RequestExecution(w http.ResponseWriter, r *http.Request, params RequestExecutionParams)
|
|
// Execution status + result
|
|
// (GET /executions/{id})
|
|
GetExecution(w http.ResponseWriter, r *http.Request, id EntityId)
|
|
// Cancel a proposed/executing execution
|
|
// (POST /executions/{id}/cancel)
|
|
CancelExecution(w http.ResponseWriter, r *http.Request, id EntityId)
|
|
// Regenerate seed YAMLs from current DB state (DR / version control)
|
|
// (GET /export)
|
|
ExportSeeds(w http.ResponseWriter, r *http.Request)
|
|
// Subgraph for visualization (nodes + edges)
|
|
// (GET /graph)
|
|
GetGraph(w http.ResponseWriter, r *http.Request, params GetGraphParams)
|
|
// Fleet health summary with trend indicators
|
|
// (GET /health)
|
|
GetFleetHealth(w http.ResponseWriter, r *http.Request)
|
|
// Full-text search over knowledge entities (documents, runbooks)
|
|
// (GET /knowledge/search)
|
|
SearchKnowledge(w http.ResponseWriter, r *http.Request, params SearchKnowledgeParams)
|
|
// All documents/runbooks linked to an entity
|
|
// (GET /knowledge/{entity_id})
|
|
GetEntityKnowledge(w http.ResponseWriter, r *http.Request, entityId string)
|
|
// Query time-series metrics
|
|
// (GET /metrics)
|
|
QueryMetrics(w http.ResponseWriter, r *http.Request, params QueryMetricsParams)
|
|
// Full ontology — entity types, relationship types, lifecycles
|
|
// (GET /ontology)
|
|
GetOntology(w http.ResponseWriter, r *http.Request)
|
|
// Extend the ontology with a new entity type
|
|
// (POST /ontology/entity-types)
|
|
CreateEntityType(w http.ResponseWriter, r *http.Request, params CreateEntityTypeParams)
|
|
// Update or deprecate an entity type
|
|
// (PATCH /ontology/entity-types/{name})
|
|
PatchEntityType(w http.ResponseWriter, r *http.Request, name string, params PatchEntityTypeParams)
|
|
// List patterns
|
|
// (GET /patterns)
|
|
ListPatterns(w http.ResponseWriter, r *http.Request, params ListPatternsParams)
|
|
// Transition a pattern (activate / invalidate / deprecate)
|
|
// (PATCH /patterns/{id})
|
|
PatchPattern(w http.ResponseWriter, r *http.Request, id EntityId, params PatchPatternParams)
|
|
// List approval rules
|
|
// (GET /policy/approval-rules)
|
|
ListApprovalRules(w http.ResponseWriter, r *http.Request)
|
|
// Propose a new approval rule (dual-control)
|
|
// (POST /policy/approval-rules)
|
|
CreateApprovalRule(w http.ResponseWriter, r *http.Request, params CreateApprovalRuleParams)
|
|
// Propose a rule change (dual-control)
|
|
// (PATCH /policy/approval-rules/{id})
|
|
PatchApprovalRule(w http.ResponseWriter, r *http.Request, id EntityId, params PatchApprovalRuleParams)
|
|
// Autonomy settings (kill-switch, never-auto-act list)
|
|
// (GET /policy/autonomy)
|
|
GetAutonomySettings(w http.ResponseWriter, r *http.Request)
|
|
// Propose autonomy changes (dual-control; kill-switch OFF is immediate)
|
|
// (PATCH /policy/autonomy)
|
|
PatchAutonomySettings(w http.ResponseWriter, r *http.Request)
|
|
// List risk classes
|
|
// (GET /policy/risk-classes)
|
|
ListRiskClasses(w http.ResponseWriter, r *http.Request)
|
|
// End a relationship (sets valid_to; the edge is kept for history)
|
|
// (DELETE /relationships)
|
|
EndRelationship(w http.ResponseWriter, r *http.Request, params EndRelationshipParams)
|
|
// Create a relationship edge
|
|
// (POST /relationships)
|
|
CreateRelationship(w http.ResponseWriter, r *http.Request, params CreateRelationshipParams)
|
|
// List signals
|
|
// (GET /signals)
|
|
ListSignals(w http.ResponseWriter, r *http.Request, params ListSignalsParams)
|
|
// Acknowledge a signal
|
|
// (POST /signals/{id}/ack)
|
|
AckSignal(w http.ResponseWriter, r *http.Request, id EntityId)
|
|
// Mute a signal for a TTL
|
|
// (POST /signals/{id}/mute)
|
|
MuteSignal(w http.ResponseWriter, r *http.Request, id EntityId)
|
|
// Resolve a signal manually
|
|
// (POST /signals/{id}/resolve)
|
|
ResolveSignal(w http.ResponseWriter, r *http.Request, id EntityId)
|
|
// List skills (latest version per skill)
|
|
// (GET /skills)
|
|
ListSkills(w http.ResponseWriter, r *http.Request, params ListSkillsParams)
|
|
// Transition a skill or pin a version
|
|
// (PATCH /skills/{id})
|
|
PatchSkill(w http.ResponseWriter, r *http.Request, id EntityId, params PatchSkillParams)
|
|
// Version history of a skill
|
|
// (GET /skills/{id}/versions)
|
|
ListSkillVersions(w http.ResponseWriter, r *http.Request, id EntityId)
|
|
// Trend analysis for all metrics on an entity
|
|
// (GET /trends/{entity_id})
|
|
GetTrends(w http.ResponseWriter, r *http.Request, entityId string, params GetTrendsParams)
|
|
}
|
|
|
|
// Unimplemented server implementation that returns http.StatusNotImplemented for each endpoint.
|
|
|
|
type Unimplemented struct{}
|
|
|
|
// Agent behavior log
|
|
// (GET /agent-activity)
|
|
func (_ Unimplemented) QueryAgentActivity(w http.ResponseWriter, r *http.Request, params QueryAgentActivityParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// List approvals
|
|
// (GET /approvals)
|
|
func (_ Unimplemented) ListApprovals(w http.ResponseWriter, r *http.Request, params ListApprovalsParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Approve or deny (single-use token verified server-side)
|
|
// (POST /approvals/{id}/decision)
|
|
func (_ Unimplemented) DecideApproval(w http.ResponseWriter, r *http.Request, id EntityId, params DecideApprovalParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Audit log
|
|
// (GET /audit)
|
|
func (_ Unimplemented) QueryAudit(w http.ResponseWriter, r *http.Request, params QueryAuditParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// List check definitions
|
|
// (GET /checks)
|
|
func (_ Unimplemented) ListChecks(w http.ResponseWriter, r *http.Request, params ListChecksParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Create a check (checks-as-data, plan R3-7)
|
|
// (POST /checks)
|
|
func (_ Unimplemented) CreateCheck(w http.ResponseWriter, r *http.Request, params CreateCheckParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Update or disable a check
|
|
// (PATCH /checks/{id})
|
|
func (_ Unimplemented) PatchCheck(w http.ResponseWriter, r *http.Request, id EntityId, params PatchCheckParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Classifier decisions (the autonomous-decision audit trail)
|
|
// (GET /classifications)
|
|
func (_ Unimplemented) ListClassifications(w http.ResponseWriter, r *http.Request, params ListClassificationsParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// List entities
|
|
// (GET /entities)
|
|
func (_ Unimplemented) ListEntities(w http.ResponseWriter, r *http.Request, params ListEntitiesParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Create an entity
|
|
// (POST /entities)
|
|
func (_ Unimplemented) CreateEntity(w http.ResponseWriter, r *http.Request, params CreateEntityParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Get entity by UUID or slug
|
|
// (GET /entities/{id})
|
|
func (_ Unimplemented) GetEntity(w http.ResponseWriter, r *http.Request, id EntityId) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Update attributes or transition lifecycle state
|
|
// (PATCH /entities/{id})
|
|
func (_ Unimplemented) PatchEntity(w http.ResponseWriter, r *http.Request, id EntityId, params PatchEntityParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Entities affected if this entity fails
|
|
// (GET /entities/{id}/blast-radius)
|
|
func (_ Unimplemented) GetBlastRadius(w http.ResponseWriter, r *http.Request, id EntityId, params GetBlastRadiusParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Direct relationships of an entity (both directions)
|
|
// (GET /entities/{id}/relations)
|
|
func (_ Unimplemented) GetEntityRelations(w http.ResponseWriter, r *http.Request, id EntityId, params GetEntityRelationsParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Historical events
|
|
// (GET /events)
|
|
func (_ Unimplemented) QueryEvents(w http.ResponseWriter, r *http.Request, params QueryEventsParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Live event stream (SSE)
|
|
// (GET /events/stream)
|
|
func (_ Unimplemented) StreamEvents(w http.ResponseWriter, r *http.Request, params StreamEventsParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// List executions
|
|
// (GET /executions)
|
|
func (_ Unimplemented) ListExecutions(w http.ResponseWriter, r *http.Request, params ListExecutionsParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Request an execution (classify → approval check → enqueue)
|
|
// (POST /executions)
|
|
func (_ Unimplemented) RequestExecution(w http.ResponseWriter, r *http.Request, params RequestExecutionParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Execution status + result
|
|
// (GET /executions/{id})
|
|
func (_ Unimplemented) GetExecution(w http.ResponseWriter, r *http.Request, id EntityId) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Cancel a proposed/executing execution
|
|
// (POST /executions/{id}/cancel)
|
|
func (_ Unimplemented) CancelExecution(w http.ResponseWriter, r *http.Request, id EntityId) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Regenerate seed YAMLs from current DB state (DR / version control)
|
|
// (GET /export)
|
|
func (_ Unimplemented) ExportSeeds(w http.ResponseWriter, r *http.Request) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Subgraph for visualization (nodes + edges)
|
|
// (GET /graph)
|
|
func (_ Unimplemented) GetGraph(w http.ResponseWriter, r *http.Request, params GetGraphParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Fleet health summary with trend indicators
|
|
// (GET /health)
|
|
func (_ Unimplemented) GetFleetHealth(w http.ResponseWriter, r *http.Request) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Full-text search over knowledge entities (documents, runbooks)
|
|
// (GET /knowledge/search)
|
|
func (_ Unimplemented) SearchKnowledge(w http.ResponseWriter, r *http.Request, params SearchKnowledgeParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// All documents/runbooks linked to an entity
|
|
// (GET /knowledge/{entity_id})
|
|
func (_ Unimplemented) GetEntityKnowledge(w http.ResponseWriter, r *http.Request, entityId string) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Query time-series metrics
|
|
// (GET /metrics)
|
|
func (_ Unimplemented) QueryMetrics(w http.ResponseWriter, r *http.Request, params QueryMetricsParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Full ontology — entity types, relationship types, lifecycles
|
|
// (GET /ontology)
|
|
func (_ Unimplemented) GetOntology(w http.ResponseWriter, r *http.Request) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Extend the ontology with a new entity type
|
|
// (POST /ontology/entity-types)
|
|
func (_ Unimplemented) CreateEntityType(w http.ResponseWriter, r *http.Request, params CreateEntityTypeParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Update or deprecate an entity type
|
|
// (PATCH /ontology/entity-types/{name})
|
|
func (_ Unimplemented) PatchEntityType(w http.ResponseWriter, r *http.Request, name string, params PatchEntityTypeParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// List patterns
|
|
// (GET /patterns)
|
|
func (_ Unimplemented) ListPatterns(w http.ResponseWriter, r *http.Request, params ListPatternsParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Transition a pattern (activate / invalidate / deprecate)
|
|
// (PATCH /patterns/{id})
|
|
func (_ Unimplemented) PatchPattern(w http.ResponseWriter, r *http.Request, id EntityId, params PatchPatternParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// List approval rules
|
|
// (GET /policy/approval-rules)
|
|
func (_ Unimplemented) ListApprovalRules(w http.ResponseWriter, r *http.Request) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Propose a new approval rule (dual-control)
|
|
// (POST /policy/approval-rules)
|
|
func (_ Unimplemented) CreateApprovalRule(w http.ResponseWriter, r *http.Request, params CreateApprovalRuleParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Propose a rule change (dual-control)
|
|
// (PATCH /policy/approval-rules/{id})
|
|
func (_ Unimplemented) PatchApprovalRule(w http.ResponseWriter, r *http.Request, id EntityId, params PatchApprovalRuleParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Autonomy settings (kill-switch, never-auto-act list)
|
|
// (GET /policy/autonomy)
|
|
func (_ Unimplemented) GetAutonomySettings(w http.ResponseWriter, r *http.Request) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Propose autonomy changes (dual-control; kill-switch OFF is immediate)
|
|
// (PATCH /policy/autonomy)
|
|
func (_ Unimplemented) PatchAutonomySettings(w http.ResponseWriter, r *http.Request) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// List risk classes
|
|
// (GET /policy/risk-classes)
|
|
func (_ Unimplemented) ListRiskClasses(w http.ResponseWriter, r *http.Request) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// End a relationship (sets valid_to; the edge is kept for history)
|
|
// (DELETE /relationships)
|
|
func (_ Unimplemented) EndRelationship(w http.ResponseWriter, r *http.Request, params EndRelationshipParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Create a relationship edge
|
|
// (POST /relationships)
|
|
func (_ Unimplemented) CreateRelationship(w http.ResponseWriter, r *http.Request, params CreateRelationshipParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// List signals
|
|
// (GET /signals)
|
|
func (_ Unimplemented) ListSignals(w http.ResponseWriter, r *http.Request, params ListSignalsParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Acknowledge a signal
|
|
// (POST /signals/{id}/ack)
|
|
func (_ Unimplemented) AckSignal(w http.ResponseWriter, r *http.Request, id EntityId) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Mute a signal for a TTL
|
|
// (POST /signals/{id}/mute)
|
|
func (_ Unimplemented) MuteSignal(w http.ResponseWriter, r *http.Request, id EntityId) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Resolve a signal manually
|
|
// (POST /signals/{id}/resolve)
|
|
func (_ Unimplemented) ResolveSignal(w http.ResponseWriter, r *http.Request, id EntityId) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// List skills (latest version per skill)
|
|
// (GET /skills)
|
|
func (_ Unimplemented) ListSkills(w http.ResponseWriter, r *http.Request, params ListSkillsParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Transition a skill or pin a version
|
|
// (PATCH /skills/{id})
|
|
func (_ Unimplemented) PatchSkill(w http.ResponseWriter, r *http.Request, id EntityId, params PatchSkillParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Version history of a skill
|
|
// (GET /skills/{id}/versions)
|
|
func (_ Unimplemented) ListSkillVersions(w http.ResponseWriter, r *http.Request, id EntityId) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Trend analysis for all metrics on an entity
|
|
// (GET /trends/{entity_id})
|
|
func (_ Unimplemented) GetTrends(w http.ResponseWriter, r *http.Request, entityId string, params GetTrendsParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// ServerInterfaceWrapper converts contexts to parameters.
|
|
type ServerInterfaceWrapper struct {
|
|
Handler ServerInterface
|
|
HandlerMiddlewares []MiddlewareFunc
|
|
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
|
|
}
|
|
|
|
type MiddlewareFunc func(http.Handler) http.Handler
|
|
|
|
// QueryAgentActivity operation middleware
|
|
func (siw *ServerInterfaceWrapper) QueryAgentActivity(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params QueryAgentActivityParams
|
|
|
|
// ------------- Optional query parameter "agent_id" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "agent_id", r.URL.Query(), ¶ms.AgentId)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "agent_id", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "activity_type" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "activity_type", r.URL.Query(), ¶ms.ActivityType)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "activity_type", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "entity_id" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "entity_id", r.URL.Query(), ¶ms.EntityId)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "entity_id", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "from" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "from", r.URL.Query(), ¶ms.From)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "from", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "to" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "to", r.URL.Query(), ¶ms.To)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "to", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "cursor" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "cursor", r.URL.Query(), ¶ms.Cursor)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "cursor", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "limit" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "limit", r.URL.Query(), ¶ms.Limit)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "limit", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.QueryAgentActivity(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListApprovals operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListApprovals(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params ListApprovalsParams
|
|
|
|
// ------------- Optional query parameter "status" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "status", r.URL.Query(), ¶ms.Status)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "status", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "kind" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "kind", r.URL.Query(), ¶ms.Kind)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "kind", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "cursor" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "cursor", r.URL.Query(), ¶ms.Cursor)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "cursor", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "limit" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "limit", r.URL.Query(), ¶ms.Limit)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "limit", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListApprovals(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// DecideApproval operation middleware
|
|
func (siw *ServerInterfaceWrapper) DecideApproval(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
var id EntityId
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", chi.URLParam(r, "id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "id", Err: err})
|
|
return
|
|
}
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params DecideApprovalParams
|
|
|
|
headers := r.Header
|
|
|
|
// ------------- Optional header parameter "Idempotency-Key" -------------
|
|
if valueList, found := headers[http.CanonicalHeaderKey("Idempotency-Key")]; found {
|
|
var IdempotencyKey IdempotencyKey
|
|
n := len(valueList)
|
|
if n != 1 {
|
|
siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Idempotency-Key", Count: n})
|
|
return
|
|
}
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "Idempotency-Key", valueList[0], &IdempotencyKey, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Idempotency-Key", Err: err})
|
|
return
|
|
}
|
|
|
|
params.IdempotencyKey = &IdempotencyKey
|
|
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.DecideApproval(w, r, id, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// QueryAudit operation middleware
|
|
func (siw *ServerInterfaceWrapper) QueryAudit(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params QueryAuditParams
|
|
|
|
// ------------- Optional query parameter "actor_type" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "actor_type", r.URL.Query(), ¶ms.ActorType)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "actor_type", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "actor_id" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "actor_id", r.URL.Query(), ¶ms.ActorId)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "actor_id", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "entity_id" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "entity_id", r.URL.Query(), ¶ms.EntityId)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "entity_id", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "action" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "action", r.URL.Query(), ¶ms.Action)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "action", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "correlation_id" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "correlation_id", r.URL.Query(), ¶ms.CorrelationId)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "correlation_id", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "from" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "from", r.URL.Query(), ¶ms.From)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "from", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "to" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "to", r.URL.Query(), ¶ms.To)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "to", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "cursor" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "cursor", r.URL.Query(), ¶ms.Cursor)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "cursor", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "limit" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "limit", r.URL.Query(), ¶ms.Limit)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "limit", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.QueryAudit(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListChecks operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListChecks(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params ListChecksParams
|
|
|
|
// ------------- Optional query parameter "kind" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "kind", r.URL.Query(), ¶ms.Kind)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "kind", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "target" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "target", r.URL.Query(), ¶ms.Target)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "target", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "enabled" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "enabled", r.URL.Query(), ¶ms.Enabled)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "enabled", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "cursor" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "cursor", r.URL.Query(), ¶ms.Cursor)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "cursor", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "limit" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "limit", r.URL.Query(), ¶ms.Limit)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "limit", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListChecks(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// CreateCheck operation middleware
|
|
func (siw *ServerInterfaceWrapper) CreateCheck(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params CreateCheckParams
|
|
|
|
headers := r.Header
|
|
|
|
// ------------- Optional header parameter "Idempotency-Key" -------------
|
|
if valueList, found := headers[http.CanonicalHeaderKey("Idempotency-Key")]; found {
|
|
var IdempotencyKey IdempotencyKey
|
|
n := len(valueList)
|
|
if n != 1 {
|
|
siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Idempotency-Key", Count: n})
|
|
return
|
|
}
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "Idempotency-Key", valueList[0], &IdempotencyKey, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Idempotency-Key", Err: err})
|
|
return
|
|
}
|
|
|
|
params.IdempotencyKey = &IdempotencyKey
|
|
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.CreateCheck(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// PatchCheck operation middleware
|
|
func (siw *ServerInterfaceWrapper) PatchCheck(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
var id EntityId
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", chi.URLParam(r, "id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "id", Err: err})
|
|
return
|
|
}
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params PatchCheckParams
|
|
|
|
headers := r.Header
|
|
|
|
// ------------- Required header parameter "If-Match" -------------
|
|
if valueList, found := headers[http.CanonicalHeaderKey("If-Match")]; found {
|
|
var IfMatch IfMatch
|
|
n := len(valueList)
|
|
if n != 1 {
|
|
siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "If-Match", Count: n})
|
|
return
|
|
}
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "If-Match", valueList[0], &IfMatch, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "If-Match", Err: err})
|
|
return
|
|
}
|
|
|
|
params.IfMatch = IfMatch
|
|
|
|
} else {
|
|
err := fmt.Errorf("Header parameter If-Match is required, but not found")
|
|
siw.ErrorHandlerFunc(w, r, &RequiredHeaderError{ParamName: "If-Match", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.PatchCheck(w, r, id, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListClassifications operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListClassifications(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params ListClassificationsParams
|
|
|
|
// ------------- Optional query parameter "signal_id" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "signal_id", r.URL.Query(), ¶ms.SignalId)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "signal_id", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "entity_id" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "entity_id", r.URL.Query(), ¶ms.EntityId)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "entity_id", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "route" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "route", r.URL.Query(), ¶ms.Route)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "route", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "cursor" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "cursor", r.URL.Query(), ¶ms.Cursor)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "cursor", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "limit" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "limit", r.URL.Query(), ¶ms.Limit)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "limit", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListClassifications(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListEntities operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListEntities(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params ListEntitiesParams
|
|
|
|
// ------------- Optional query parameter "type" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "type", r.URL.Query(), ¶ms.Type)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "type", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "state" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "state", r.URL.Query(), ¶ms.State)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "state", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "domain" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "domain", r.URL.Query(), ¶ms.Domain)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "domain", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "layer" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "layer", r.URL.Query(), ¶ms.Layer)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "layer", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "q" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "q", r.URL.Query(), ¶ms.Q)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "q", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "cursor" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "cursor", r.URL.Query(), ¶ms.Cursor)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "cursor", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "limit" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "limit", r.URL.Query(), ¶ms.Limit)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "limit", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListEntities(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// CreateEntity operation middleware
|
|
func (siw *ServerInterfaceWrapper) CreateEntity(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params CreateEntityParams
|
|
|
|
headers := r.Header
|
|
|
|
// ------------- Optional header parameter "Idempotency-Key" -------------
|
|
if valueList, found := headers[http.CanonicalHeaderKey("Idempotency-Key")]; found {
|
|
var IdempotencyKey IdempotencyKey
|
|
n := len(valueList)
|
|
if n != 1 {
|
|
siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Idempotency-Key", Count: n})
|
|
return
|
|
}
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "Idempotency-Key", valueList[0], &IdempotencyKey, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Idempotency-Key", Err: err})
|
|
return
|
|
}
|
|
|
|
params.IdempotencyKey = &IdempotencyKey
|
|
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.CreateEntity(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetEntity operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetEntity(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
var id EntityId
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", chi.URLParam(r, "id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "id", Err: err})
|
|
return
|
|
}
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetEntity(w, r, id)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// PatchEntity operation middleware
|
|
func (siw *ServerInterfaceWrapper) PatchEntity(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
var id EntityId
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", chi.URLParam(r, "id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "id", Err: err})
|
|
return
|
|
}
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params PatchEntityParams
|
|
|
|
headers := r.Header
|
|
|
|
// ------------- Required header parameter "If-Match" -------------
|
|
if valueList, found := headers[http.CanonicalHeaderKey("If-Match")]; found {
|
|
var IfMatch IfMatch
|
|
n := len(valueList)
|
|
if n != 1 {
|
|
siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "If-Match", Count: n})
|
|
return
|
|
}
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "If-Match", valueList[0], &IfMatch, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "If-Match", Err: err})
|
|
return
|
|
}
|
|
|
|
params.IfMatch = IfMatch
|
|
|
|
} else {
|
|
err := fmt.Errorf("Header parameter If-Match is required, but not found")
|
|
siw.ErrorHandlerFunc(w, r, &RequiredHeaderError{ParamName: "If-Match", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.PatchEntity(w, r, id, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetBlastRadius operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetBlastRadius(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
var id EntityId
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", chi.URLParam(r, "id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "id", Err: err})
|
|
return
|
|
}
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params GetBlastRadiusParams
|
|
|
|
// ------------- Optional query parameter "depth" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "depth", r.URL.Query(), ¶ms.Depth)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "depth", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetBlastRadius(w, r, id, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetEntityRelations operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetEntityRelations(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
var id EntityId
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", chi.URLParam(r, "id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "id", Err: err})
|
|
return
|
|
}
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params GetEntityRelationsParams
|
|
|
|
// ------------- Optional query parameter "rel_type" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "rel_type", r.URL.Query(), ¶ms.RelType)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "rel_type", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "direction" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "direction", r.URL.Query(), ¶ms.Direction)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "direction", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetEntityRelations(w, r, id, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// QueryEvents operation middleware
|
|
func (siw *ServerInterfaceWrapper) QueryEvents(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params QueryEventsParams
|
|
|
|
// ------------- Optional query parameter "type" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "type", r.URL.Query(), ¶ms.Type)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "type", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "entity_id" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "entity_id", r.URL.Query(), ¶ms.EntityId)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "entity_id", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "severity" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "severity", r.URL.Query(), ¶ms.Severity)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "severity", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "correlation_id" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "correlation_id", r.URL.Query(), ¶ms.CorrelationId)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "correlation_id", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "from" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "from", r.URL.Query(), ¶ms.From)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "from", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "to" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "to", r.URL.Query(), ¶ms.To)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "to", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "cursor" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "cursor", r.URL.Query(), ¶ms.Cursor)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "cursor", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "limit" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "limit", r.URL.Query(), ¶ms.Limit)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "limit", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.QueryEvents(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// StreamEvents operation middleware
|
|
func (siw *ServerInterfaceWrapper) StreamEvents(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params StreamEventsParams
|
|
|
|
// ------------- Optional query parameter "type" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "type", r.URL.Query(), ¶ms.Type)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "type", Err: err})
|
|
return
|
|
}
|
|
|
|
headers := r.Header
|
|
|
|
// ------------- Optional header parameter "Last-Event-ID" -------------
|
|
if valueList, found := headers[http.CanonicalHeaderKey("Last-Event-ID")]; found {
|
|
var LastEventID string
|
|
n := len(valueList)
|
|
if n != 1 {
|
|
siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Last-Event-ID", Count: n})
|
|
return
|
|
}
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "Last-Event-ID", valueList[0], &LastEventID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Last-Event-ID", Err: err})
|
|
return
|
|
}
|
|
|
|
params.LastEventID = &LastEventID
|
|
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.StreamEvents(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListExecutions operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListExecutions(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params ListExecutionsParams
|
|
|
|
// ------------- Optional query parameter "status" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "status", r.URL.Query(), ¶ms.Status)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "status", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "target" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "target", r.URL.Query(), ¶ms.Target)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "target", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "action" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "action", r.URL.Query(), ¶ms.Action)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "action", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "correlation_id" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "correlation_id", r.URL.Query(), ¶ms.CorrelationId)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "correlation_id", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "cursor" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "cursor", r.URL.Query(), ¶ms.Cursor)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "cursor", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "limit" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "limit", r.URL.Query(), ¶ms.Limit)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "limit", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListExecutions(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// RequestExecution operation middleware
|
|
func (siw *ServerInterfaceWrapper) RequestExecution(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params RequestExecutionParams
|
|
|
|
headers := r.Header
|
|
|
|
// ------------- Optional header parameter "Idempotency-Key" -------------
|
|
if valueList, found := headers[http.CanonicalHeaderKey("Idempotency-Key")]; found {
|
|
var IdempotencyKey IdempotencyKey
|
|
n := len(valueList)
|
|
if n != 1 {
|
|
siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Idempotency-Key", Count: n})
|
|
return
|
|
}
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "Idempotency-Key", valueList[0], &IdempotencyKey, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Idempotency-Key", Err: err})
|
|
return
|
|
}
|
|
|
|
params.IdempotencyKey = &IdempotencyKey
|
|
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.RequestExecution(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetExecution operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetExecution(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
var id EntityId
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", chi.URLParam(r, "id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "id", Err: err})
|
|
return
|
|
}
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetExecution(w, r, id)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// CancelExecution operation middleware
|
|
func (siw *ServerInterfaceWrapper) CancelExecution(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
var id EntityId
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", chi.URLParam(r, "id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "id", Err: err})
|
|
return
|
|
}
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.CancelExecution(w, r, id)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ExportSeeds operation middleware
|
|
func (siw *ServerInterfaceWrapper) ExportSeeds(w http.ResponseWriter, r *http.Request) {
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ExportSeeds(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetGraph operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetGraph(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params GetGraphParams
|
|
|
|
// ------------- Optional query parameter "root" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "root", r.URL.Query(), ¶ms.Root)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "root", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "depth" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "depth", r.URL.Query(), ¶ms.Depth)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "depth", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "rel_type" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "rel_type", r.URL.Query(), ¶ms.RelType)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "rel_type", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetGraph(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetFleetHealth operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetFleetHealth(w http.ResponseWriter, r *http.Request) {
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetFleetHealth(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// SearchKnowledge operation middleware
|
|
func (siw *ServerInterfaceWrapper) SearchKnowledge(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params SearchKnowledgeParams
|
|
|
|
// ------------- Required query parameter "q" -------------
|
|
|
|
if paramValue := r.URL.Query().Get("q"); paramValue != "" {
|
|
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "q"})
|
|
return
|
|
}
|
|
|
|
err = runtime.BindQueryParameter("form", true, true, "q", r.URL.Query(), ¶ms.Q)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "q", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "limit" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "limit", r.URL.Query(), ¶ms.Limit)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "limit", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.SearchKnowledge(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetEntityKnowledge operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetEntityKnowledge(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "entity_id" -------------
|
|
var entityId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "entity_id", chi.URLParam(r, "entity_id"), &entityId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "entity_id", Err: err})
|
|
return
|
|
}
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetEntityKnowledge(w, r, entityId)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// QueryMetrics operation middleware
|
|
func (siw *ServerInterfaceWrapper) QueryMetrics(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params QueryMetricsParams
|
|
|
|
// ------------- Optional query parameter "entity_id" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "entity_id", r.URL.Query(), ¶ms.EntityId)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "entity_id", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "metric" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "metric", r.URL.Query(), ¶ms.Metric)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "metric", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "rollup" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "rollup", r.URL.Query(), ¶ms.Rollup)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "rollup", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "from" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "from", r.URL.Query(), ¶ms.From)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "from", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "to" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "to", r.URL.Query(), ¶ms.To)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "to", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.QueryMetrics(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetOntology operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetOntology(w http.ResponseWriter, r *http.Request) {
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetOntology(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// CreateEntityType operation middleware
|
|
func (siw *ServerInterfaceWrapper) CreateEntityType(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params CreateEntityTypeParams
|
|
|
|
headers := r.Header
|
|
|
|
// ------------- Optional header parameter "Idempotency-Key" -------------
|
|
if valueList, found := headers[http.CanonicalHeaderKey("Idempotency-Key")]; found {
|
|
var IdempotencyKey IdempotencyKey
|
|
n := len(valueList)
|
|
if n != 1 {
|
|
siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Idempotency-Key", Count: n})
|
|
return
|
|
}
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "Idempotency-Key", valueList[0], &IdempotencyKey, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Idempotency-Key", Err: err})
|
|
return
|
|
}
|
|
|
|
params.IdempotencyKey = &IdempotencyKey
|
|
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.CreateEntityType(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// PatchEntityType operation middleware
|
|
func (siw *ServerInterfaceWrapper) PatchEntityType(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "name" -------------
|
|
var name string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "name", chi.URLParam(r, "name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "name", Err: err})
|
|
return
|
|
}
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params PatchEntityTypeParams
|
|
|
|
headers := r.Header
|
|
|
|
// ------------- Required header parameter "If-Match" -------------
|
|
if valueList, found := headers[http.CanonicalHeaderKey("If-Match")]; found {
|
|
var IfMatch IfMatch
|
|
n := len(valueList)
|
|
if n != 1 {
|
|
siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "If-Match", Count: n})
|
|
return
|
|
}
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "If-Match", valueList[0], &IfMatch, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "If-Match", Err: err})
|
|
return
|
|
}
|
|
|
|
params.IfMatch = IfMatch
|
|
|
|
} else {
|
|
err := fmt.Errorf("Header parameter If-Match is required, but not found")
|
|
siw.ErrorHandlerFunc(w, r, &RequiredHeaderError{ParamName: "If-Match", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.PatchEntityType(w, r, name, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListPatterns operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListPatterns(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params ListPatternsParams
|
|
|
|
// ------------- Optional query parameter "entity_type" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "entity_type", r.URL.Query(), ¶ms.EntityType)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "entity_type", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "action" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "action", r.URL.Query(), ¶ms.Action)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "action", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "status" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "status", r.URL.Query(), ¶ms.Status)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "status", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "cursor" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "cursor", r.URL.Query(), ¶ms.Cursor)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "cursor", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "limit" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "limit", r.URL.Query(), ¶ms.Limit)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "limit", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListPatterns(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// PatchPattern operation middleware
|
|
func (siw *ServerInterfaceWrapper) PatchPattern(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
var id EntityId
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", chi.URLParam(r, "id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "id", Err: err})
|
|
return
|
|
}
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params PatchPatternParams
|
|
|
|
headers := r.Header
|
|
|
|
// ------------- Required header parameter "If-Match" -------------
|
|
if valueList, found := headers[http.CanonicalHeaderKey("If-Match")]; found {
|
|
var IfMatch IfMatch
|
|
n := len(valueList)
|
|
if n != 1 {
|
|
siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "If-Match", Count: n})
|
|
return
|
|
}
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "If-Match", valueList[0], &IfMatch, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "If-Match", Err: err})
|
|
return
|
|
}
|
|
|
|
params.IfMatch = IfMatch
|
|
|
|
} else {
|
|
err := fmt.Errorf("Header parameter If-Match is required, but not found")
|
|
siw.ErrorHandlerFunc(w, r, &RequiredHeaderError{ParamName: "If-Match", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.PatchPattern(w, r, id, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListApprovalRules operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListApprovalRules(w http.ResponseWriter, r *http.Request) {
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListApprovalRules(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// CreateApprovalRule operation middleware
|
|
func (siw *ServerInterfaceWrapper) CreateApprovalRule(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params CreateApprovalRuleParams
|
|
|
|
headers := r.Header
|
|
|
|
// ------------- Optional header parameter "Idempotency-Key" -------------
|
|
if valueList, found := headers[http.CanonicalHeaderKey("Idempotency-Key")]; found {
|
|
var IdempotencyKey IdempotencyKey
|
|
n := len(valueList)
|
|
if n != 1 {
|
|
siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Idempotency-Key", Count: n})
|
|
return
|
|
}
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "Idempotency-Key", valueList[0], &IdempotencyKey, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Idempotency-Key", Err: err})
|
|
return
|
|
}
|
|
|
|
params.IdempotencyKey = &IdempotencyKey
|
|
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.CreateApprovalRule(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// PatchApprovalRule operation middleware
|
|
func (siw *ServerInterfaceWrapper) PatchApprovalRule(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
var id EntityId
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", chi.URLParam(r, "id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "id", Err: err})
|
|
return
|
|
}
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params PatchApprovalRuleParams
|
|
|
|
headers := r.Header
|
|
|
|
// ------------- Required header parameter "If-Match" -------------
|
|
if valueList, found := headers[http.CanonicalHeaderKey("If-Match")]; found {
|
|
var IfMatch IfMatch
|
|
n := len(valueList)
|
|
if n != 1 {
|
|
siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "If-Match", Count: n})
|
|
return
|
|
}
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "If-Match", valueList[0], &IfMatch, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "If-Match", Err: err})
|
|
return
|
|
}
|
|
|
|
params.IfMatch = IfMatch
|
|
|
|
} else {
|
|
err := fmt.Errorf("Header parameter If-Match is required, but not found")
|
|
siw.ErrorHandlerFunc(w, r, &RequiredHeaderError{ParamName: "If-Match", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.PatchApprovalRule(w, r, id, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetAutonomySettings operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetAutonomySettings(w http.ResponseWriter, r *http.Request) {
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetAutonomySettings(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// PatchAutonomySettings operation middleware
|
|
func (siw *ServerInterfaceWrapper) PatchAutonomySettings(w http.ResponseWriter, r *http.Request) {
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.PatchAutonomySettings(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListRiskClasses operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListRiskClasses(w http.ResponseWriter, r *http.Request) {
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListRiskClasses(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// EndRelationship operation middleware
|
|
func (siw *ServerInterfaceWrapper) EndRelationship(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params EndRelationshipParams
|
|
|
|
// ------------- Required query parameter "source" -------------
|
|
|
|
if paramValue := r.URL.Query().Get("source"); paramValue != "" {
|
|
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "source"})
|
|
return
|
|
}
|
|
|
|
err = runtime.BindQueryParameter("form", true, true, "source", r.URL.Query(), ¶ms.Source)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "source", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Required query parameter "target" -------------
|
|
|
|
if paramValue := r.URL.Query().Get("target"); paramValue != "" {
|
|
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "target"})
|
|
return
|
|
}
|
|
|
|
err = runtime.BindQueryParameter("form", true, true, "target", r.URL.Query(), ¶ms.Target)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "target", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Required query parameter "rel_type" -------------
|
|
|
|
if paramValue := r.URL.Query().Get("rel_type"); paramValue != "" {
|
|
|
|
} else {
|
|
siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "rel_type"})
|
|
return
|
|
}
|
|
|
|
err = runtime.BindQueryParameter("form", true, true, "rel_type", r.URL.Query(), ¶ms.RelType)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "rel_type", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.EndRelationship(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// CreateRelationship operation middleware
|
|
func (siw *ServerInterfaceWrapper) CreateRelationship(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params CreateRelationshipParams
|
|
|
|
headers := r.Header
|
|
|
|
// ------------- Optional header parameter "Idempotency-Key" -------------
|
|
if valueList, found := headers[http.CanonicalHeaderKey("Idempotency-Key")]; found {
|
|
var IdempotencyKey IdempotencyKey
|
|
n := len(valueList)
|
|
if n != 1 {
|
|
siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Idempotency-Key", Count: n})
|
|
return
|
|
}
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "Idempotency-Key", valueList[0], &IdempotencyKey, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Idempotency-Key", Err: err})
|
|
return
|
|
}
|
|
|
|
params.IdempotencyKey = &IdempotencyKey
|
|
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.CreateRelationship(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListSignals operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListSignals(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params ListSignalsParams
|
|
|
|
// ------------- Optional query parameter "state" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "state", r.URL.Query(), ¶ms.State)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "state", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "severity" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "severity", r.URL.Query(), ¶ms.Severity)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "severity", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "entity_id" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "entity_id", r.URL.Query(), ¶ms.EntityId)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "entity_id", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "kind" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "kind", r.URL.Query(), ¶ms.Kind)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "kind", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "cursor" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "cursor", r.URL.Query(), ¶ms.Cursor)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "cursor", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "limit" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "limit", r.URL.Query(), ¶ms.Limit)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "limit", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListSignals(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// AckSignal operation middleware
|
|
func (siw *ServerInterfaceWrapper) AckSignal(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
var id EntityId
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", chi.URLParam(r, "id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "id", Err: err})
|
|
return
|
|
}
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.AckSignal(w, r, id)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// MuteSignal operation middleware
|
|
func (siw *ServerInterfaceWrapper) MuteSignal(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
var id EntityId
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", chi.URLParam(r, "id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "id", Err: err})
|
|
return
|
|
}
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.MuteSignal(w, r, id)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ResolveSignal operation middleware
|
|
func (siw *ServerInterfaceWrapper) ResolveSignal(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
var id EntityId
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", chi.URLParam(r, "id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "id", Err: err})
|
|
return
|
|
}
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ResolveSignal(w, r, id)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListSkills operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListSkills(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params ListSkillsParams
|
|
|
|
// ------------- Optional query parameter "applies_to" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "applies_to", r.URL.Query(), ¶ms.AppliesTo)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "applies_to", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "action" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "action", r.URL.Query(), ¶ms.Action)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "action", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "status" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "status", r.URL.Query(), ¶ms.Status)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "status", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "cursor" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "cursor", r.URL.Query(), ¶ms.Cursor)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "cursor", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "limit" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "limit", r.URL.Query(), ¶ms.Limit)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "limit", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListSkills(w, r, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// PatchSkill operation middleware
|
|
func (siw *ServerInterfaceWrapper) PatchSkill(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
var id EntityId
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", chi.URLParam(r, "id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "id", Err: err})
|
|
return
|
|
}
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params PatchSkillParams
|
|
|
|
headers := r.Header
|
|
|
|
// ------------- Required header parameter "If-Match" -------------
|
|
if valueList, found := headers[http.CanonicalHeaderKey("If-Match")]; found {
|
|
var IfMatch IfMatch
|
|
n := len(valueList)
|
|
if n != 1 {
|
|
siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "If-Match", Count: n})
|
|
return
|
|
}
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "If-Match", valueList[0], &IfMatch, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "If-Match", Err: err})
|
|
return
|
|
}
|
|
|
|
params.IfMatch = IfMatch
|
|
|
|
} else {
|
|
err := fmt.Errorf("Header parameter If-Match is required, but not found")
|
|
siw.ErrorHandlerFunc(w, r, &RequiredHeaderError{ParamName: "If-Match", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.PatchSkill(w, r, id, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// ListSkillVersions operation middleware
|
|
func (siw *ServerInterfaceWrapper) ListSkillVersions(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "id" -------------
|
|
var id EntityId
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "id", chi.URLParam(r, "id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "id", Err: err})
|
|
return
|
|
}
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.ListSkillVersions(w, r, id)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetTrends operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetTrends(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "entity_id" -------------
|
|
var entityId string
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "entity_id", chi.URLParam(r, "entity_id"), &entityId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "entity_id", Err: err})
|
|
return
|
|
}
|
|
|
|
ctx := r.Context()
|
|
|
|
ctx = context.WithValue(ctx, BearerAuthScopes, []string{})
|
|
|
|
r = r.WithContext(ctx)
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params GetTrendsParams
|
|
|
|
// ------------- Optional query parameter "from" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "from", r.URL.Query(), ¶ms.From)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "from", Err: err})
|
|
return
|
|
}
|
|
|
|
// ------------- Optional query parameter "to" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "to", r.URL.Query(), ¶ms.To)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "to", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetTrends(w, r, entityId, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
type UnescapedCookieParamError struct {
|
|
ParamName string
|
|
Err error
|
|
}
|
|
|
|
func (e *UnescapedCookieParamError) Error() string {
|
|
return fmt.Sprintf("error unescaping cookie parameter '%s'", e.ParamName)
|
|
}
|
|
|
|
func (e *UnescapedCookieParamError) Unwrap() error {
|
|
return e.Err
|
|
}
|
|
|
|
type UnmarshalingParamError struct {
|
|
ParamName string
|
|
Err error
|
|
}
|
|
|
|
func (e *UnmarshalingParamError) Error() string {
|
|
return fmt.Sprintf("Error unmarshaling parameter %s as JSON: %s", e.ParamName, e.Err.Error())
|
|
}
|
|
|
|
func (e *UnmarshalingParamError) Unwrap() error {
|
|
return e.Err
|
|
}
|
|
|
|
type RequiredParamError struct {
|
|
ParamName string
|
|
}
|
|
|
|
func (e *RequiredParamError) Error() string {
|
|
return fmt.Sprintf("Query argument %s is required, but not found", e.ParamName)
|
|
}
|
|
|
|
type RequiredHeaderError struct {
|
|
ParamName string
|
|
Err error
|
|
}
|
|
|
|
func (e *RequiredHeaderError) Error() string {
|
|
return fmt.Sprintf("Header parameter %s is required, but not found", e.ParamName)
|
|
}
|
|
|
|
func (e *RequiredHeaderError) Unwrap() error {
|
|
return e.Err
|
|
}
|
|
|
|
type InvalidParamFormatError struct {
|
|
ParamName string
|
|
Err error
|
|
}
|
|
|
|
func (e *InvalidParamFormatError) Error() string {
|
|
return fmt.Sprintf("Invalid format for parameter %s: %s", e.ParamName, e.Err.Error())
|
|
}
|
|
|
|
func (e *InvalidParamFormatError) Unwrap() error {
|
|
return e.Err
|
|
}
|
|
|
|
type TooManyValuesForParamError struct {
|
|
ParamName string
|
|
Count int
|
|
}
|
|
|
|
func (e *TooManyValuesForParamError) Error() string {
|
|
return fmt.Sprintf("Expected one value for %s, got %d", e.ParamName, e.Count)
|
|
}
|
|
|
|
// Handler creates http.Handler with routing matching OpenAPI spec.
|
|
func Handler(si ServerInterface) http.Handler {
|
|
return HandlerWithOptions(si, ChiServerOptions{})
|
|
}
|
|
|
|
type ChiServerOptions struct {
|
|
BaseURL string
|
|
BaseRouter chi.Router
|
|
Middlewares []MiddlewareFunc
|
|
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
|
|
}
|
|
|
|
// HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
|
|
func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler {
|
|
return HandlerWithOptions(si, ChiServerOptions{
|
|
BaseRouter: r,
|
|
})
|
|
}
|
|
|
|
func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler {
|
|
return HandlerWithOptions(si, ChiServerOptions{
|
|
BaseURL: baseURL,
|
|
BaseRouter: r,
|
|
})
|
|
}
|
|
|
|
// HandlerWithOptions creates http.Handler with additional options
|
|
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler {
|
|
r := options.BaseRouter
|
|
|
|
if r == nil {
|
|
r = chi.NewRouter()
|
|
}
|
|
if options.ErrorHandlerFunc == nil {
|
|
options.ErrorHandlerFunc = func(w http.ResponseWriter, r *http.Request, err error) {
|
|
http.Error(w, err.Error(), http.StatusBadRequest)
|
|
}
|
|
}
|
|
wrapper := ServerInterfaceWrapper{
|
|
Handler: si,
|
|
HandlerMiddlewares: options.Middlewares,
|
|
ErrorHandlerFunc: options.ErrorHandlerFunc,
|
|
}
|
|
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/agent-activity", wrapper.QueryAgentActivity)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/approvals", wrapper.ListApprovals)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Post(options.BaseURL+"/approvals/{id}/decision", wrapper.DecideApproval)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/audit", wrapper.QueryAudit)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/checks", wrapper.ListChecks)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Post(options.BaseURL+"/checks", wrapper.CreateCheck)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Patch(options.BaseURL+"/checks/{id}", wrapper.PatchCheck)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/classifications", wrapper.ListClassifications)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/entities", wrapper.ListEntities)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Post(options.BaseURL+"/entities", wrapper.CreateEntity)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/entities/{id}", wrapper.GetEntity)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Patch(options.BaseURL+"/entities/{id}", wrapper.PatchEntity)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/entities/{id}/blast-radius", wrapper.GetBlastRadius)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/entities/{id}/relations", wrapper.GetEntityRelations)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/events", wrapper.QueryEvents)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/events/stream", wrapper.StreamEvents)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/executions", wrapper.ListExecutions)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Post(options.BaseURL+"/executions", wrapper.RequestExecution)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/executions/{id}", wrapper.GetExecution)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Post(options.BaseURL+"/executions/{id}/cancel", wrapper.CancelExecution)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/export", wrapper.ExportSeeds)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/graph", wrapper.GetGraph)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/health", wrapper.GetFleetHealth)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/knowledge/search", wrapper.SearchKnowledge)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/knowledge/{entity_id}", wrapper.GetEntityKnowledge)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/metrics", wrapper.QueryMetrics)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/ontology", wrapper.GetOntology)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Post(options.BaseURL+"/ontology/entity-types", wrapper.CreateEntityType)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Patch(options.BaseURL+"/ontology/entity-types/{name}", wrapper.PatchEntityType)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/patterns", wrapper.ListPatterns)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Patch(options.BaseURL+"/patterns/{id}", wrapper.PatchPattern)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/policy/approval-rules", wrapper.ListApprovalRules)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Post(options.BaseURL+"/policy/approval-rules", wrapper.CreateApprovalRule)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Patch(options.BaseURL+"/policy/approval-rules/{id}", wrapper.PatchApprovalRule)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/policy/autonomy", wrapper.GetAutonomySettings)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Patch(options.BaseURL+"/policy/autonomy", wrapper.PatchAutonomySettings)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/policy/risk-classes", wrapper.ListRiskClasses)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Delete(options.BaseURL+"/relationships", wrapper.EndRelationship)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Post(options.BaseURL+"/relationships", wrapper.CreateRelationship)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/signals", wrapper.ListSignals)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Post(options.BaseURL+"/signals/{id}/ack", wrapper.AckSignal)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Post(options.BaseURL+"/signals/{id}/mute", wrapper.MuteSignal)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Post(options.BaseURL+"/signals/{id}/resolve", wrapper.ResolveSignal)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/skills", wrapper.ListSkills)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Patch(options.BaseURL+"/skills/{id}", wrapper.PatchSkill)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/skills/{id}/versions", wrapper.ListSkillVersions)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/trends/{entity_id}", wrapper.GetTrends)
|
|
})
|
|
|
|
return r
|
|
}
|
|
|
|
type PendingApprovalJSONResponse Approval
|
|
|
|
type ProblemApplicationProblemPlusJSONResponse Problem
|
|
|
|
type SignalUpdatedJSONResponse Signal
|
|
|
|
type QueryAgentActivityRequestObject struct {
|
|
Params QueryAgentActivityParams
|
|
}
|
|
|
|
type QueryAgentActivityResponseObject interface {
|
|
VisitQueryAgentActivityResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type QueryAgentActivity200JSONResponse struct {
|
|
Items []AgentActivity `json:"items"`
|
|
NextCursor *string `json:"next_cursor"`
|
|
}
|
|
|
|
func (response QueryAgentActivity200JSONResponse) VisitQueryAgentActivityResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type QueryAgentActivitydefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response QueryAgentActivitydefaultApplicationProblemPlusJSONResponse) VisitQueryAgentActivityResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type ListApprovalsRequestObject struct {
|
|
Params ListApprovalsParams
|
|
}
|
|
|
|
type ListApprovalsResponseObject interface {
|
|
VisitListApprovalsResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type ListApprovals200JSONResponse struct {
|
|
Items []Approval `json:"items"`
|
|
NextCursor *string `json:"next_cursor"`
|
|
}
|
|
|
|
func (response ListApprovals200JSONResponse) VisitListApprovalsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type ListApprovalsdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response ListApprovalsdefaultApplicationProblemPlusJSONResponse) VisitListApprovalsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type DecideApprovalRequestObject struct {
|
|
Id EntityId `json:"id"`
|
|
Params DecideApprovalParams
|
|
Body *DecideApprovalJSONRequestBody
|
|
}
|
|
|
|
type DecideApprovalResponseObject interface {
|
|
VisitDecideApprovalResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type DecideApproval200JSONResponse Approval
|
|
|
|
func (response DecideApproval200JSONResponse) VisitDecideApprovalResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type DecideApprovaldefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response DecideApprovaldefaultApplicationProblemPlusJSONResponse) VisitDecideApprovalResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type QueryAuditRequestObject struct {
|
|
Params QueryAuditParams
|
|
}
|
|
|
|
type QueryAuditResponseObject interface {
|
|
VisitQueryAuditResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type QueryAudit200JSONResponse struct {
|
|
Items []AuditEntry `json:"items"`
|
|
NextCursor *string `json:"next_cursor"`
|
|
}
|
|
|
|
func (response QueryAudit200JSONResponse) VisitQueryAuditResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type QueryAuditdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response QueryAuditdefaultApplicationProblemPlusJSONResponse) VisitQueryAuditResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type ListChecksRequestObject struct {
|
|
Params ListChecksParams
|
|
}
|
|
|
|
type ListChecksResponseObject interface {
|
|
VisitListChecksResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type ListChecks200JSONResponse struct {
|
|
Items []Check `json:"items"`
|
|
NextCursor *string `json:"next_cursor"`
|
|
}
|
|
|
|
func (response ListChecks200JSONResponse) VisitListChecksResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type ListChecksdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response ListChecksdefaultApplicationProblemPlusJSONResponse) VisitListChecksResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type CreateCheckRequestObject struct {
|
|
Params CreateCheckParams
|
|
Body *CreateCheckJSONRequestBody
|
|
}
|
|
|
|
type CreateCheckResponseObject interface {
|
|
VisitCreateCheckResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type CreateCheck201JSONResponse Check
|
|
|
|
func (response CreateCheck201JSONResponse) VisitCreateCheckResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(201)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type CreateCheckdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response CreateCheckdefaultApplicationProblemPlusJSONResponse) VisitCreateCheckResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type PatchCheckRequestObject struct {
|
|
Id EntityId `json:"id"`
|
|
Params PatchCheckParams
|
|
Body *PatchCheckJSONRequestBody
|
|
}
|
|
|
|
type PatchCheckResponseObject interface {
|
|
VisitPatchCheckResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type PatchCheck200JSONResponse Check
|
|
|
|
func (response PatchCheck200JSONResponse) VisitPatchCheckResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type PatchCheckdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response PatchCheckdefaultApplicationProblemPlusJSONResponse) VisitPatchCheckResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type ListClassificationsRequestObject struct {
|
|
Params ListClassificationsParams
|
|
}
|
|
|
|
type ListClassificationsResponseObject interface {
|
|
VisitListClassificationsResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type ListClassifications200JSONResponse struct {
|
|
Items []Classification `json:"items"`
|
|
NextCursor *string `json:"next_cursor"`
|
|
}
|
|
|
|
func (response ListClassifications200JSONResponse) VisitListClassificationsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type ListClassificationsdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response ListClassificationsdefaultApplicationProblemPlusJSONResponse) VisitListClassificationsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type ListEntitiesRequestObject struct {
|
|
Params ListEntitiesParams
|
|
}
|
|
|
|
type ListEntitiesResponseObject interface {
|
|
VisitListEntitiesResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type ListEntities200JSONResponse struct {
|
|
Items []Entity `json:"items"`
|
|
NextCursor *string `json:"next_cursor"`
|
|
}
|
|
|
|
func (response ListEntities200JSONResponse) VisitListEntitiesResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type ListEntitiesdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response ListEntitiesdefaultApplicationProblemPlusJSONResponse) VisitListEntitiesResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type CreateEntityRequestObject struct {
|
|
Params CreateEntityParams
|
|
Body *CreateEntityJSONRequestBody
|
|
}
|
|
|
|
type CreateEntityResponseObject interface {
|
|
VisitCreateEntityResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type CreateEntity201ResponseHeaders struct {
|
|
ETag string
|
|
}
|
|
|
|
type CreateEntity201JSONResponse struct {
|
|
Body Entity
|
|
Headers CreateEntity201ResponseHeaders
|
|
}
|
|
|
|
func (response CreateEntity201JSONResponse) VisitCreateEntityResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.Header().Set("ETag", fmt.Sprint(response.Headers.ETag))
|
|
w.WriteHeader(201)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type CreateEntitydefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response CreateEntitydefaultApplicationProblemPlusJSONResponse) VisitCreateEntityResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type GetEntityRequestObject struct {
|
|
Id EntityId `json:"id"`
|
|
}
|
|
|
|
type GetEntityResponseObject interface {
|
|
VisitGetEntityResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type GetEntity200ResponseHeaders struct {
|
|
ETag string
|
|
}
|
|
|
|
type GetEntity200JSONResponse struct {
|
|
Body Entity
|
|
Headers GetEntity200ResponseHeaders
|
|
}
|
|
|
|
func (response GetEntity200JSONResponse) VisitGetEntityResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.Header().Set("ETag", fmt.Sprint(response.Headers.ETag))
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type GetEntitydefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response GetEntitydefaultApplicationProblemPlusJSONResponse) VisitGetEntityResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type PatchEntityRequestObject struct {
|
|
Id EntityId `json:"id"`
|
|
Params PatchEntityParams
|
|
Body *PatchEntityJSONRequestBody
|
|
}
|
|
|
|
type PatchEntityResponseObject interface {
|
|
VisitPatchEntityResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type PatchEntity200ResponseHeaders struct {
|
|
ETag string
|
|
}
|
|
|
|
type PatchEntity200JSONResponse struct {
|
|
Body Entity
|
|
Headers PatchEntity200ResponseHeaders
|
|
}
|
|
|
|
func (response PatchEntity200JSONResponse) VisitPatchEntityResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.Header().Set("ETag", fmt.Sprint(response.Headers.ETag))
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type PatchEntitydefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response PatchEntitydefaultApplicationProblemPlusJSONResponse) VisitPatchEntityResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type GetBlastRadiusRequestObject struct {
|
|
Id EntityId `json:"id"`
|
|
Params GetBlastRadiusParams
|
|
}
|
|
|
|
type GetBlastRadiusResponseObject interface {
|
|
VisitGetBlastRadiusResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type GetBlastRadius200JSONResponse struct {
|
|
Items []struct {
|
|
Depth int `json:"depth"`
|
|
Entity Entity `json:"entity"`
|
|
} `json:"items"`
|
|
}
|
|
|
|
func (response GetBlastRadius200JSONResponse) VisitGetBlastRadiusResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type GetBlastRadiusdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response GetBlastRadiusdefaultApplicationProblemPlusJSONResponse) VisitGetBlastRadiusResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type GetEntityRelationsRequestObject struct {
|
|
Id EntityId `json:"id"`
|
|
Params GetEntityRelationsParams
|
|
}
|
|
|
|
type GetEntityRelationsResponseObject interface {
|
|
VisitGetEntityRelationsResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type GetEntityRelations200JSONResponse struct {
|
|
Items []Relationship `json:"items"`
|
|
}
|
|
|
|
func (response GetEntityRelations200JSONResponse) VisitGetEntityRelationsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type GetEntityRelationsdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response GetEntityRelationsdefaultApplicationProblemPlusJSONResponse) VisitGetEntityRelationsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type QueryEventsRequestObject struct {
|
|
Params QueryEventsParams
|
|
}
|
|
|
|
type QueryEventsResponseObject interface {
|
|
VisitQueryEventsResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type QueryEvents200JSONResponse struct {
|
|
Items []Event `json:"items"`
|
|
NextCursor *string `json:"next_cursor"`
|
|
}
|
|
|
|
func (response QueryEvents200JSONResponse) VisitQueryEventsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type QueryEventsdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response QueryEventsdefaultApplicationProblemPlusJSONResponse) VisitQueryEventsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type StreamEventsRequestObject struct {
|
|
Params StreamEventsParams
|
|
}
|
|
|
|
type StreamEventsResponseObject interface {
|
|
VisitStreamEventsResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type StreamEvents200TexteventStreamResponse struct {
|
|
Body io.Reader
|
|
ContentLength int64
|
|
}
|
|
|
|
func (response StreamEvents200TexteventStreamResponse) VisitStreamEventsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "text/event-stream")
|
|
if response.ContentLength != 0 {
|
|
w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength))
|
|
}
|
|
w.WriteHeader(200)
|
|
|
|
if closer, ok := response.Body.(io.ReadCloser); ok {
|
|
defer closer.Close()
|
|
}
|
|
_, err := io.Copy(w, response.Body)
|
|
return err
|
|
}
|
|
|
|
type StreamEventsdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response StreamEventsdefaultApplicationProblemPlusJSONResponse) VisitStreamEventsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type ListExecutionsRequestObject struct {
|
|
Params ListExecutionsParams
|
|
}
|
|
|
|
type ListExecutionsResponseObject interface {
|
|
VisitListExecutionsResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type ListExecutions200JSONResponse struct {
|
|
Items []Execution `json:"items"`
|
|
NextCursor *string `json:"next_cursor"`
|
|
}
|
|
|
|
func (response ListExecutions200JSONResponse) VisitListExecutionsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type ListExecutionsdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response ListExecutionsdefaultApplicationProblemPlusJSONResponse) VisitListExecutionsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type RequestExecutionRequestObject struct {
|
|
Params RequestExecutionParams
|
|
Body *RequestExecutionJSONRequestBody
|
|
}
|
|
|
|
type RequestExecutionResponseObject interface {
|
|
VisitRequestExecutionResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type RequestExecution201JSONResponse Execution
|
|
|
|
func (response RequestExecution201JSONResponse) VisitRequestExecutionResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(201)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type RequestExecutiondefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response RequestExecutiondefaultApplicationProblemPlusJSONResponse) VisitRequestExecutionResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type GetExecutionRequestObject struct {
|
|
Id EntityId `json:"id"`
|
|
}
|
|
|
|
type GetExecutionResponseObject interface {
|
|
VisitGetExecutionResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type GetExecution200JSONResponse Execution
|
|
|
|
func (response GetExecution200JSONResponse) VisitGetExecutionResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type GetExecutiondefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response GetExecutiondefaultApplicationProblemPlusJSONResponse) VisitGetExecutionResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type CancelExecutionRequestObject struct {
|
|
Id EntityId `json:"id"`
|
|
}
|
|
|
|
type CancelExecutionResponseObject interface {
|
|
VisitCancelExecutionResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type CancelExecution200JSONResponse Execution
|
|
|
|
func (response CancelExecution200JSONResponse) VisitCancelExecutionResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type CancelExecutiondefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response CancelExecutiondefaultApplicationProblemPlusJSONResponse) VisitCancelExecutionResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type ExportSeedsRequestObject struct {
|
|
}
|
|
|
|
type ExportSeedsResponseObject interface {
|
|
VisitExportSeedsResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type ExportSeeds200JSONResponse struct {
|
|
// Inventory YAML document
|
|
Inventory string `json:"inventory"`
|
|
|
|
// Ontology YAML document
|
|
Ontology string `json:"ontology"`
|
|
|
|
// Policy YAML document
|
|
Policy string `json:"policy"`
|
|
}
|
|
|
|
func (response ExportSeeds200JSONResponse) VisitExportSeedsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type ExportSeedsdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response ExportSeedsdefaultApplicationProblemPlusJSONResponse) VisitExportSeedsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type GetGraphRequestObject struct {
|
|
Params GetGraphParams
|
|
}
|
|
|
|
type GetGraphResponseObject interface {
|
|
VisitGetGraphResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type GetGraph200JSONResponse GraphView
|
|
|
|
func (response GetGraph200JSONResponse) VisitGetGraphResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type GetGraphdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response GetGraphdefaultApplicationProblemPlusJSONResponse) VisitGetGraphResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type GetFleetHealthRequestObject struct {
|
|
}
|
|
|
|
type GetFleetHealthResponseObject interface {
|
|
VisitGetFleetHealthResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type GetFleetHealth200JSONResponse HealthSummary
|
|
|
|
func (response GetFleetHealth200JSONResponse) VisitGetFleetHealthResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type GetFleetHealthdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response GetFleetHealthdefaultApplicationProblemPlusJSONResponse) VisitGetFleetHealthResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type SearchKnowledgeRequestObject struct {
|
|
Params SearchKnowledgeParams
|
|
}
|
|
|
|
type SearchKnowledgeResponseObject interface {
|
|
VisitSearchKnowledgeResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type SearchKnowledge200JSONResponse struct {
|
|
Items []KnowledgeHit `json:"items"`
|
|
}
|
|
|
|
func (response SearchKnowledge200JSONResponse) VisitSearchKnowledgeResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type SearchKnowledgedefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response SearchKnowledgedefaultApplicationProblemPlusJSONResponse) VisitSearchKnowledgeResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type GetEntityKnowledgeRequestObject struct {
|
|
EntityId string `json:"entity_id"`
|
|
}
|
|
|
|
type GetEntityKnowledgeResponseObject interface {
|
|
VisitGetEntityKnowledgeResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type GetEntityKnowledge200JSONResponse struct {
|
|
Items []KnowledgeHit `json:"items"`
|
|
}
|
|
|
|
func (response GetEntityKnowledge200JSONResponse) VisitGetEntityKnowledgeResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type GetEntityKnowledgedefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response GetEntityKnowledgedefaultApplicationProblemPlusJSONResponse) VisitGetEntityKnowledgeResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type QueryMetricsRequestObject struct {
|
|
Params QueryMetricsParams
|
|
}
|
|
|
|
type QueryMetricsResponseObject interface {
|
|
VisitQueryMetricsResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type QueryMetrics200JSONResponse struct {
|
|
Items []MetricSeries `json:"items"`
|
|
}
|
|
|
|
func (response QueryMetrics200JSONResponse) VisitQueryMetricsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type QueryMetricsdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response QueryMetricsdefaultApplicationProblemPlusJSONResponse) VisitQueryMetricsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type GetOntologyRequestObject struct {
|
|
}
|
|
|
|
type GetOntologyResponseObject interface {
|
|
VisitGetOntologyResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type GetOntology200JSONResponse struct {
|
|
EntityTypes []EntityType `json:"entity_types"`
|
|
Lifecycles []LifecycleDef `json:"lifecycles"`
|
|
RelationshipTypes []RelationshipType `json:"relationship_types"`
|
|
}
|
|
|
|
func (response GetOntology200JSONResponse) VisitGetOntologyResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type GetOntologydefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response GetOntologydefaultApplicationProblemPlusJSONResponse) VisitGetOntologyResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type CreateEntityTypeRequestObject struct {
|
|
Params CreateEntityTypeParams
|
|
Body *CreateEntityTypeJSONRequestBody
|
|
}
|
|
|
|
type CreateEntityTypeResponseObject interface {
|
|
VisitCreateEntityTypeResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type CreateEntityType201JSONResponse EntityType
|
|
|
|
func (response CreateEntityType201JSONResponse) VisitCreateEntityTypeResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(201)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type CreateEntityType202JSONResponse struct{ PendingApprovalJSONResponse }
|
|
|
|
func (response CreateEntityType202JSONResponse) VisitCreateEntityTypeResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(202)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type CreateEntityTypedefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response CreateEntityTypedefaultApplicationProblemPlusJSONResponse) VisitCreateEntityTypeResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type PatchEntityTypeRequestObject struct {
|
|
Name string `json:"name"`
|
|
Params PatchEntityTypeParams
|
|
Body *PatchEntityTypeJSONRequestBody
|
|
}
|
|
|
|
type PatchEntityTypeResponseObject interface {
|
|
VisitPatchEntityTypeResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type PatchEntityType200JSONResponse EntityType
|
|
|
|
func (response PatchEntityType200JSONResponse) VisitPatchEntityTypeResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type PatchEntityType202JSONResponse struct{ PendingApprovalJSONResponse }
|
|
|
|
func (response PatchEntityType202JSONResponse) VisitPatchEntityTypeResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(202)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type PatchEntityTypedefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response PatchEntityTypedefaultApplicationProblemPlusJSONResponse) VisitPatchEntityTypeResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type ListPatternsRequestObject struct {
|
|
Params ListPatternsParams
|
|
}
|
|
|
|
type ListPatternsResponseObject interface {
|
|
VisitListPatternsResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type ListPatterns200JSONResponse struct {
|
|
Items []Pattern `json:"items"`
|
|
NextCursor *string `json:"next_cursor"`
|
|
}
|
|
|
|
func (response ListPatterns200JSONResponse) VisitListPatternsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type ListPatternsdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response ListPatternsdefaultApplicationProblemPlusJSONResponse) VisitListPatternsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type PatchPatternRequestObject struct {
|
|
Id EntityId `json:"id"`
|
|
Params PatchPatternParams
|
|
Body *PatchPatternJSONRequestBody
|
|
}
|
|
|
|
type PatchPatternResponseObject interface {
|
|
VisitPatchPatternResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type PatchPattern200JSONResponse Pattern
|
|
|
|
func (response PatchPattern200JSONResponse) VisitPatchPatternResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type PatchPattern202JSONResponse struct{ PendingApprovalJSONResponse }
|
|
|
|
func (response PatchPattern202JSONResponse) VisitPatchPatternResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(202)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type PatchPatterndefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response PatchPatterndefaultApplicationProblemPlusJSONResponse) VisitPatchPatternResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type ListApprovalRulesRequestObject struct {
|
|
}
|
|
|
|
type ListApprovalRulesResponseObject interface {
|
|
VisitListApprovalRulesResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type ListApprovalRules200JSONResponse struct {
|
|
Items []ApprovalRule `json:"items"`
|
|
}
|
|
|
|
func (response ListApprovalRules200JSONResponse) VisitListApprovalRulesResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type ListApprovalRulesdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response ListApprovalRulesdefaultApplicationProblemPlusJSONResponse) VisitListApprovalRulesResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type CreateApprovalRuleRequestObject struct {
|
|
Params CreateApprovalRuleParams
|
|
Body *CreateApprovalRuleJSONRequestBody
|
|
}
|
|
|
|
type CreateApprovalRuleResponseObject interface {
|
|
VisitCreateApprovalRuleResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type CreateApprovalRule202JSONResponse struct{ PendingApprovalJSONResponse }
|
|
|
|
func (response CreateApprovalRule202JSONResponse) VisitCreateApprovalRuleResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(202)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type CreateApprovalRuledefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response CreateApprovalRuledefaultApplicationProblemPlusJSONResponse) VisitCreateApprovalRuleResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type PatchApprovalRuleRequestObject struct {
|
|
Id EntityId `json:"id"`
|
|
Params PatchApprovalRuleParams
|
|
Body *PatchApprovalRuleJSONRequestBody
|
|
}
|
|
|
|
type PatchApprovalRuleResponseObject interface {
|
|
VisitPatchApprovalRuleResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type PatchApprovalRule202JSONResponse struct{ PendingApprovalJSONResponse }
|
|
|
|
func (response PatchApprovalRule202JSONResponse) VisitPatchApprovalRuleResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(202)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type PatchApprovalRuledefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response PatchApprovalRuledefaultApplicationProblemPlusJSONResponse) VisitPatchApprovalRuleResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type GetAutonomySettingsRequestObject struct {
|
|
}
|
|
|
|
type GetAutonomySettingsResponseObject interface {
|
|
VisitGetAutonomySettingsResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type GetAutonomySettings200JSONResponse struct {
|
|
Items []AutonomySetting `json:"items"`
|
|
}
|
|
|
|
func (response GetAutonomySettings200JSONResponse) VisitGetAutonomySettingsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type GetAutonomySettingsdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response GetAutonomySettingsdefaultApplicationProblemPlusJSONResponse) VisitGetAutonomySettingsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type PatchAutonomySettingsRequestObject struct {
|
|
Body *PatchAutonomySettingsJSONRequestBody
|
|
}
|
|
|
|
type PatchAutonomySettingsResponseObject interface {
|
|
VisitPatchAutonomySettingsResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type PatchAutonomySettings200JSONResponse struct {
|
|
Items []AutonomySetting `json:"items"`
|
|
}
|
|
|
|
func (response PatchAutonomySettings200JSONResponse) VisitPatchAutonomySettingsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type PatchAutonomySettings202JSONResponse struct{ PendingApprovalJSONResponse }
|
|
|
|
func (response PatchAutonomySettings202JSONResponse) VisitPatchAutonomySettingsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(202)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type PatchAutonomySettingsdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response PatchAutonomySettingsdefaultApplicationProblemPlusJSONResponse) VisitPatchAutonomySettingsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type ListRiskClassesRequestObject struct {
|
|
}
|
|
|
|
type ListRiskClassesResponseObject interface {
|
|
VisitListRiskClassesResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type ListRiskClasses200JSONResponse struct {
|
|
Items []RiskClass `json:"items"`
|
|
}
|
|
|
|
func (response ListRiskClasses200JSONResponse) VisitListRiskClassesResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type ListRiskClassesdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response ListRiskClassesdefaultApplicationProblemPlusJSONResponse) VisitListRiskClassesResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type EndRelationshipRequestObject struct {
|
|
Params EndRelationshipParams
|
|
}
|
|
|
|
type EndRelationshipResponseObject interface {
|
|
VisitEndRelationshipResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type EndRelationship204Response struct {
|
|
}
|
|
|
|
func (response EndRelationship204Response) VisitEndRelationshipResponse(w http.ResponseWriter) error {
|
|
w.WriteHeader(204)
|
|
return nil
|
|
}
|
|
|
|
type EndRelationshipdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response EndRelationshipdefaultApplicationProblemPlusJSONResponse) VisitEndRelationshipResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type CreateRelationshipRequestObject struct {
|
|
Params CreateRelationshipParams
|
|
Body *CreateRelationshipJSONRequestBody
|
|
}
|
|
|
|
type CreateRelationshipResponseObject interface {
|
|
VisitCreateRelationshipResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type CreateRelationship201JSONResponse Relationship
|
|
|
|
func (response CreateRelationship201JSONResponse) VisitCreateRelationshipResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(201)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type CreateRelationshipdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response CreateRelationshipdefaultApplicationProblemPlusJSONResponse) VisitCreateRelationshipResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type ListSignalsRequestObject struct {
|
|
Params ListSignalsParams
|
|
}
|
|
|
|
type ListSignalsResponseObject interface {
|
|
VisitListSignalsResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type ListSignals200JSONResponse struct {
|
|
Items []Signal `json:"items"`
|
|
NextCursor *string `json:"next_cursor"`
|
|
}
|
|
|
|
func (response ListSignals200JSONResponse) VisitListSignalsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type ListSignalsdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response ListSignalsdefaultApplicationProblemPlusJSONResponse) VisitListSignalsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type AckSignalRequestObject struct {
|
|
Id EntityId `json:"id"`
|
|
}
|
|
|
|
type AckSignalResponseObject interface {
|
|
VisitAckSignalResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type AckSignal200JSONResponse struct{ SignalUpdatedJSONResponse }
|
|
|
|
func (response AckSignal200JSONResponse) VisitAckSignalResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type AckSignaldefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response AckSignaldefaultApplicationProblemPlusJSONResponse) VisitAckSignalResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type MuteSignalRequestObject struct {
|
|
Id EntityId `json:"id"`
|
|
Body *MuteSignalJSONRequestBody
|
|
}
|
|
|
|
type MuteSignalResponseObject interface {
|
|
VisitMuteSignalResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type MuteSignal200JSONResponse struct{ SignalUpdatedJSONResponse }
|
|
|
|
func (response MuteSignal200JSONResponse) VisitMuteSignalResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type MuteSignaldefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response MuteSignaldefaultApplicationProblemPlusJSONResponse) VisitMuteSignalResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type ResolveSignalRequestObject struct {
|
|
Id EntityId `json:"id"`
|
|
Body *ResolveSignalJSONRequestBody
|
|
}
|
|
|
|
type ResolveSignalResponseObject interface {
|
|
VisitResolveSignalResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type ResolveSignal200JSONResponse struct{ SignalUpdatedJSONResponse }
|
|
|
|
func (response ResolveSignal200JSONResponse) VisitResolveSignalResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type ResolveSignaldefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response ResolveSignaldefaultApplicationProblemPlusJSONResponse) VisitResolveSignalResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type ListSkillsRequestObject struct {
|
|
Params ListSkillsParams
|
|
}
|
|
|
|
type ListSkillsResponseObject interface {
|
|
VisitListSkillsResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type ListSkills200JSONResponse struct {
|
|
Items []Skill `json:"items"`
|
|
NextCursor *string `json:"next_cursor"`
|
|
}
|
|
|
|
func (response ListSkills200JSONResponse) VisitListSkillsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type ListSkillsdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response ListSkillsdefaultApplicationProblemPlusJSONResponse) VisitListSkillsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type PatchSkillRequestObject struct {
|
|
Id EntityId `json:"id"`
|
|
Params PatchSkillParams
|
|
Body *PatchSkillJSONRequestBody
|
|
}
|
|
|
|
type PatchSkillResponseObject interface {
|
|
VisitPatchSkillResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type PatchSkill200JSONResponse Skill
|
|
|
|
func (response PatchSkill200JSONResponse) VisitPatchSkillResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type PatchSkill202JSONResponse struct{ PendingApprovalJSONResponse }
|
|
|
|
func (response PatchSkill202JSONResponse) VisitPatchSkillResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(202)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type PatchSkilldefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response PatchSkilldefaultApplicationProblemPlusJSONResponse) VisitPatchSkillResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type ListSkillVersionsRequestObject struct {
|
|
Id EntityId `json:"id"`
|
|
}
|
|
|
|
type ListSkillVersionsResponseObject interface {
|
|
VisitListSkillVersionsResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type ListSkillVersions200JSONResponse struct {
|
|
Items []Skill `json:"items"`
|
|
}
|
|
|
|
func (response ListSkillVersions200JSONResponse) VisitListSkillVersionsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type ListSkillVersionsdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response ListSkillVersionsdefaultApplicationProblemPlusJSONResponse) VisitListSkillVersionsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type GetTrendsRequestObject struct {
|
|
EntityId string `json:"entity_id"`
|
|
Params GetTrendsParams
|
|
}
|
|
|
|
type GetTrendsResponseObject interface {
|
|
VisitGetTrendsResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type GetTrends200JSONResponse struct {
|
|
Items []Trend `json:"items"`
|
|
}
|
|
|
|
func (response GetTrends200JSONResponse) VisitGetTrendsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type GetTrendsdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response GetTrendsdefaultApplicationProblemPlusJSONResponse) VisitGetTrendsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
// StrictServerInterface represents all server handlers.
|
|
type StrictServerInterface interface {
|
|
// Agent behavior log
|
|
// (GET /agent-activity)
|
|
QueryAgentActivity(ctx context.Context, request QueryAgentActivityRequestObject) (QueryAgentActivityResponseObject, error)
|
|
// List approvals
|
|
// (GET /approvals)
|
|
ListApprovals(ctx context.Context, request ListApprovalsRequestObject) (ListApprovalsResponseObject, error)
|
|
// Approve or deny (single-use token verified server-side)
|
|
// (POST /approvals/{id}/decision)
|
|
DecideApproval(ctx context.Context, request DecideApprovalRequestObject) (DecideApprovalResponseObject, error)
|
|
// Audit log
|
|
// (GET /audit)
|
|
QueryAudit(ctx context.Context, request QueryAuditRequestObject) (QueryAuditResponseObject, error)
|
|
// List check definitions
|
|
// (GET /checks)
|
|
ListChecks(ctx context.Context, request ListChecksRequestObject) (ListChecksResponseObject, error)
|
|
// Create a check (checks-as-data, plan R3-7)
|
|
// (POST /checks)
|
|
CreateCheck(ctx context.Context, request CreateCheckRequestObject) (CreateCheckResponseObject, error)
|
|
// Update or disable a check
|
|
// (PATCH /checks/{id})
|
|
PatchCheck(ctx context.Context, request PatchCheckRequestObject) (PatchCheckResponseObject, error)
|
|
// Classifier decisions (the autonomous-decision audit trail)
|
|
// (GET /classifications)
|
|
ListClassifications(ctx context.Context, request ListClassificationsRequestObject) (ListClassificationsResponseObject, error)
|
|
// List entities
|
|
// (GET /entities)
|
|
ListEntities(ctx context.Context, request ListEntitiesRequestObject) (ListEntitiesResponseObject, error)
|
|
// Create an entity
|
|
// (POST /entities)
|
|
CreateEntity(ctx context.Context, request CreateEntityRequestObject) (CreateEntityResponseObject, error)
|
|
// Get entity by UUID or slug
|
|
// (GET /entities/{id})
|
|
GetEntity(ctx context.Context, request GetEntityRequestObject) (GetEntityResponseObject, error)
|
|
// Update attributes or transition lifecycle state
|
|
// (PATCH /entities/{id})
|
|
PatchEntity(ctx context.Context, request PatchEntityRequestObject) (PatchEntityResponseObject, error)
|
|
// Entities affected if this entity fails
|
|
// (GET /entities/{id}/blast-radius)
|
|
GetBlastRadius(ctx context.Context, request GetBlastRadiusRequestObject) (GetBlastRadiusResponseObject, error)
|
|
// Direct relationships of an entity (both directions)
|
|
// (GET /entities/{id}/relations)
|
|
GetEntityRelations(ctx context.Context, request GetEntityRelationsRequestObject) (GetEntityRelationsResponseObject, error)
|
|
// Historical events
|
|
// (GET /events)
|
|
QueryEvents(ctx context.Context, request QueryEventsRequestObject) (QueryEventsResponseObject, error)
|
|
// Live event stream (SSE)
|
|
// (GET /events/stream)
|
|
StreamEvents(ctx context.Context, request StreamEventsRequestObject) (StreamEventsResponseObject, error)
|
|
// List executions
|
|
// (GET /executions)
|
|
ListExecutions(ctx context.Context, request ListExecutionsRequestObject) (ListExecutionsResponseObject, error)
|
|
// Request an execution (classify → approval check → enqueue)
|
|
// (POST /executions)
|
|
RequestExecution(ctx context.Context, request RequestExecutionRequestObject) (RequestExecutionResponseObject, error)
|
|
// Execution status + result
|
|
// (GET /executions/{id})
|
|
GetExecution(ctx context.Context, request GetExecutionRequestObject) (GetExecutionResponseObject, error)
|
|
// Cancel a proposed/executing execution
|
|
// (POST /executions/{id}/cancel)
|
|
CancelExecution(ctx context.Context, request CancelExecutionRequestObject) (CancelExecutionResponseObject, error)
|
|
// Regenerate seed YAMLs from current DB state (DR / version control)
|
|
// (GET /export)
|
|
ExportSeeds(ctx context.Context, request ExportSeedsRequestObject) (ExportSeedsResponseObject, error)
|
|
// Subgraph for visualization (nodes + edges)
|
|
// (GET /graph)
|
|
GetGraph(ctx context.Context, request GetGraphRequestObject) (GetGraphResponseObject, error)
|
|
// Fleet health summary with trend indicators
|
|
// (GET /health)
|
|
GetFleetHealth(ctx context.Context, request GetFleetHealthRequestObject) (GetFleetHealthResponseObject, error)
|
|
// Full-text search over knowledge entities (documents, runbooks)
|
|
// (GET /knowledge/search)
|
|
SearchKnowledge(ctx context.Context, request SearchKnowledgeRequestObject) (SearchKnowledgeResponseObject, error)
|
|
// All documents/runbooks linked to an entity
|
|
// (GET /knowledge/{entity_id})
|
|
GetEntityKnowledge(ctx context.Context, request GetEntityKnowledgeRequestObject) (GetEntityKnowledgeResponseObject, error)
|
|
// Query time-series metrics
|
|
// (GET /metrics)
|
|
QueryMetrics(ctx context.Context, request QueryMetricsRequestObject) (QueryMetricsResponseObject, error)
|
|
// Full ontology — entity types, relationship types, lifecycles
|
|
// (GET /ontology)
|
|
GetOntology(ctx context.Context, request GetOntologyRequestObject) (GetOntologyResponseObject, error)
|
|
// Extend the ontology with a new entity type
|
|
// (POST /ontology/entity-types)
|
|
CreateEntityType(ctx context.Context, request CreateEntityTypeRequestObject) (CreateEntityTypeResponseObject, error)
|
|
// Update or deprecate an entity type
|
|
// (PATCH /ontology/entity-types/{name})
|
|
PatchEntityType(ctx context.Context, request PatchEntityTypeRequestObject) (PatchEntityTypeResponseObject, error)
|
|
// List patterns
|
|
// (GET /patterns)
|
|
ListPatterns(ctx context.Context, request ListPatternsRequestObject) (ListPatternsResponseObject, error)
|
|
// Transition a pattern (activate / invalidate / deprecate)
|
|
// (PATCH /patterns/{id})
|
|
PatchPattern(ctx context.Context, request PatchPatternRequestObject) (PatchPatternResponseObject, error)
|
|
// List approval rules
|
|
// (GET /policy/approval-rules)
|
|
ListApprovalRules(ctx context.Context, request ListApprovalRulesRequestObject) (ListApprovalRulesResponseObject, error)
|
|
// Propose a new approval rule (dual-control)
|
|
// (POST /policy/approval-rules)
|
|
CreateApprovalRule(ctx context.Context, request CreateApprovalRuleRequestObject) (CreateApprovalRuleResponseObject, error)
|
|
// Propose a rule change (dual-control)
|
|
// (PATCH /policy/approval-rules/{id})
|
|
PatchApprovalRule(ctx context.Context, request PatchApprovalRuleRequestObject) (PatchApprovalRuleResponseObject, error)
|
|
// Autonomy settings (kill-switch, never-auto-act list)
|
|
// (GET /policy/autonomy)
|
|
GetAutonomySettings(ctx context.Context, request GetAutonomySettingsRequestObject) (GetAutonomySettingsResponseObject, error)
|
|
// Propose autonomy changes (dual-control; kill-switch OFF is immediate)
|
|
// (PATCH /policy/autonomy)
|
|
PatchAutonomySettings(ctx context.Context, request PatchAutonomySettingsRequestObject) (PatchAutonomySettingsResponseObject, error)
|
|
// List risk classes
|
|
// (GET /policy/risk-classes)
|
|
ListRiskClasses(ctx context.Context, request ListRiskClassesRequestObject) (ListRiskClassesResponseObject, error)
|
|
// End a relationship (sets valid_to; the edge is kept for history)
|
|
// (DELETE /relationships)
|
|
EndRelationship(ctx context.Context, request EndRelationshipRequestObject) (EndRelationshipResponseObject, error)
|
|
// Create a relationship edge
|
|
// (POST /relationships)
|
|
CreateRelationship(ctx context.Context, request CreateRelationshipRequestObject) (CreateRelationshipResponseObject, error)
|
|
// List signals
|
|
// (GET /signals)
|
|
ListSignals(ctx context.Context, request ListSignalsRequestObject) (ListSignalsResponseObject, error)
|
|
// Acknowledge a signal
|
|
// (POST /signals/{id}/ack)
|
|
AckSignal(ctx context.Context, request AckSignalRequestObject) (AckSignalResponseObject, error)
|
|
// Mute a signal for a TTL
|
|
// (POST /signals/{id}/mute)
|
|
MuteSignal(ctx context.Context, request MuteSignalRequestObject) (MuteSignalResponseObject, error)
|
|
// Resolve a signal manually
|
|
// (POST /signals/{id}/resolve)
|
|
ResolveSignal(ctx context.Context, request ResolveSignalRequestObject) (ResolveSignalResponseObject, error)
|
|
// List skills (latest version per skill)
|
|
// (GET /skills)
|
|
ListSkills(ctx context.Context, request ListSkillsRequestObject) (ListSkillsResponseObject, error)
|
|
// Transition a skill or pin a version
|
|
// (PATCH /skills/{id})
|
|
PatchSkill(ctx context.Context, request PatchSkillRequestObject) (PatchSkillResponseObject, error)
|
|
// Version history of a skill
|
|
// (GET /skills/{id}/versions)
|
|
ListSkillVersions(ctx context.Context, request ListSkillVersionsRequestObject) (ListSkillVersionsResponseObject, error)
|
|
// Trend analysis for all metrics on an entity
|
|
// (GET /trends/{entity_id})
|
|
GetTrends(ctx context.Context, request GetTrendsRequestObject) (GetTrendsResponseObject, error)
|
|
}
|
|
|
|
type StrictHandlerFunc = strictnethttp.StrictHTTPHandlerFunc
|
|
type StrictMiddlewareFunc = strictnethttp.StrictHTTPMiddlewareFunc
|
|
|
|
type StrictHTTPServerOptions struct {
|
|
RequestErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
|
|
ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
|
|
}
|
|
|
|
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface {
|
|
return &strictHandler{ssi: ssi, middlewares: middlewares, options: StrictHTTPServerOptions{
|
|
RequestErrorHandlerFunc: func(w http.ResponseWriter, r *http.Request, err error) {
|
|
http.Error(w, err.Error(), http.StatusBadRequest)
|
|
},
|
|
ResponseErrorHandlerFunc: func(w http.ResponseWriter, r *http.Request, err error) {
|
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
|
},
|
|
}}
|
|
}
|
|
|
|
func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface {
|
|
return &strictHandler{ssi: ssi, middlewares: middlewares, options: options}
|
|
}
|
|
|
|
type strictHandler struct {
|
|
ssi StrictServerInterface
|
|
middlewares []StrictMiddlewareFunc
|
|
options StrictHTTPServerOptions
|
|
}
|
|
|
|
// QueryAgentActivity operation middleware
|
|
func (sh *strictHandler) QueryAgentActivity(w http.ResponseWriter, r *http.Request, params QueryAgentActivityParams) {
|
|
var request QueryAgentActivityRequestObject
|
|
|
|
request.Params = params
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.QueryAgentActivity(ctx, request.(QueryAgentActivityRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "QueryAgentActivity")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(QueryAgentActivityResponseObject); ok {
|
|
if err := validResponse.VisitQueryAgentActivityResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// ListApprovals operation middleware
|
|
func (sh *strictHandler) ListApprovals(w http.ResponseWriter, r *http.Request, params ListApprovalsParams) {
|
|
var request ListApprovalsRequestObject
|
|
|
|
request.Params = params
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.ListApprovals(ctx, request.(ListApprovalsRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "ListApprovals")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(ListApprovalsResponseObject); ok {
|
|
if err := validResponse.VisitListApprovalsResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// DecideApproval operation middleware
|
|
func (sh *strictHandler) DecideApproval(w http.ResponseWriter, r *http.Request, id EntityId, params DecideApprovalParams) {
|
|
var request DecideApprovalRequestObject
|
|
|
|
request.Id = id
|
|
request.Params = params
|
|
|
|
var body DecideApprovalJSONRequestBody
|
|
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
|
sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err))
|
|
return
|
|
}
|
|
request.Body = &body
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.DecideApproval(ctx, request.(DecideApprovalRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "DecideApproval")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(DecideApprovalResponseObject); ok {
|
|
if err := validResponse.VisitDecideApprovalResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// QueryAudit operation middleware
|
|
func (sh *strictHandler) QueryAudit(w http.ResponseWriter, r *http.Request, params QueryAuditParams) {
|
|
var request QueryAuditRequestObject
|
|
|
|
request.Params = params
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.QueryAudit(ctx, request.(QueryAuditRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "QueryAudit")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(QueryAuditResponseObject); ok {
|
|
if err := validResponse.VisitQueryAuditResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// ListChecks operation middleware
|
|
func (sh *strictHandler) ListChecks(w http.ResponseWriter, r *http.Request, params ListChecksParams) {
|
|
var request ListChecksRequestObject
|
|
|
|
request.Params = params
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.ListChecks(ctx, request.(ListChecksRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "ListChecks")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(ListChecksResponseObject); ok {
|
|
if err := validResponse.VisitListChecksResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// CreateCheck operation middleware
|
|
func (sh *strictHandler) CreateCheck(w http.ResponseWriter, r *http.Request, params CreateCheckParams) {
|
|
var request CreateCheckRequestObject
|
|
|
|
request.Params = params
|
|
|
|
var body CreateCheckJSONRequestBody
|
|
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
|
sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err))
|
|
return
|
|
}
|
|
request.Body = &body
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.CreateCheck(ctx, request.(CreateCheckRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "CreateCheck")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(CreateCheckResponseObject); ok {
|
|
if err := validResponse.VisitCreateCheckResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// PatchCheck operation middleware
|
|
func (sh *strictHandler) PatchCheck(w http.ResponseWriter, r *http.Request, id EntityId, params PatchCheckParams) {
|
|
var request PatchCheckRequestObject
|
|
|
|
request.Id = id
|
|
request.Params = params
|
|
|
|
var body PatchCheckJSONRequestBody
|
|
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
|
sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err))
|
|
return
|
|
}
|
|
request.Body = &body
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.PatchCheck(ctx, request.(PatchCheckRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "PatchCheck")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(PatchCheckResponseObject); ok {
|
|
if err := validResponse.VisitPatchCheckResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// ListClassifications operation middleware
|
|
func (sh *strictHandler) ListClassifications(w http.ResponseWriter, r *http.Request, params ListClassificationsParams) {
|
|
var request ListClassificationsRequestObject
|
|
|
|
request.Params = params
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.ListClassifications(ctx, request.(ListClassificationsRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "ListClassifications")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(ListClassificationsResponseObject); ok {
|
|
if err := validResponse.VisitListClassificationsResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// ListEntities operation middleware
|
|
func (sh *strictHandler) ListEntities(w http.ResponseWriter, r *http.Request, params ListEntitiesParams) {
|
|
var request ListEntitiesRequestObject
|
|
|
|
request.Params = params
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.ListEntities(ctx, request.(ListEntitiesRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "ListEntities")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(ListEntitiesResponseObject); ok {
|
|
if err := validResponse.VisitListEntitiesResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// CreateEntity operation middleware
|
|
func (sh *strictHandler) CreateEntity(w http.ResponseWriter, r *http.Request, params CreateEntityParams) {
|
|
var request CreateEntityRequestObject
|
|
|
|
request.Params = params
|
|
|
|
var body CreateEntityJSONRequestBody
|
|
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
|
sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err))
|
|
return
|
|
}
|
|
request.Body = &body
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.CreateEntity(ctx, request.(CreateEntityRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "CreateEntity")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(CreateEntityResponseObject); ok {
|
|
if err := validResponse.VisitCreateEntityResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// GetEntity operation middleware
|
|
func (sh *strictHandler) GetEntity(w http.ResponseWriter, r *http.Request, id EntityId) {
|
|
var request GetEntityRequestObject
|
|
|
|
request.Id = id
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.GetEntity(ctx, request.(GetEntityRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "GetEntity")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(GetEntityResponseObject); ok {
|
|
if err := validResponse.VisitGetEntityResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// PatchEntity operation middleware
|
|
func (sh *strictHandler) PatchEntity(w http.ResponseWriter, r *http.Request, id EntityId, params PatchEntityParams) {
|
|
var request PatchEntityRequestObject
|
|
|
|
request.Id = id
|
|
request.Params = params
|
|
|
|
var body PatchEntityJSONRequestBody
|
|
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
|
sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err))
|
|
return
|
|
}
|
|
request.Body = &body
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.PatchEntity(ctx, request.(PatchEntityRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "PatchEntity")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(PatchEntityResponseObject); ok {
|
|
if err := validResponse.VisitPatchEntityResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// GetBlastRadius operation middleware
|
|
func (sh *strictHandler) GetBlastRadius(w http.ResponseWriter, r *http.Request, id EntityId, params GetBlastRadiusParams) {
|
|
var request GetBlastRadiusRequestObject
|
|
|
|
request.Id = id
|
|
request.Params = params
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.GetBlastRadius(ctx, request.(GetBlastRadiusRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "GetBlastRadius")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(GetBlastRadiusResponseObject); ok {
|
|
if err := validResponse.VisitGetBlastRadiusResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// GetEntityRelations operation middleware
|
|
func (sh *strictHandler) GetEntityRelations(w http.ResponseWriter, r *http.Request, id EntityId, params GetEntityRelationsParams) {
|
|
var request GetEntityRelationsRequestObject
|
|
|
|
request.Id = id
|
|
request.Params = params
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.GetEntityRelations(ctx, request.(GetEntityRelationsRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "GetEntityRelations")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(GetEntityRelationsResponseObject); ok {
|
|
if err := validResponse.VisitGetEntityRelationsResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// QueryEvents operation middleware
|
|
func (sh *strictHandler) QueryEvents(w http.ResponseWriter, r *http.Request, params QueryEventsParams) {
|
|
var request QueryEventsRequestObject
|
|
|
|
request.Params = params
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.QueryEvents(ctx, request.(QueryEventsRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "QueryEvents")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(QueryEventsResponseObject); ok {
|
|
if err := validResponse.VisitQueryEventsResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// StreamEvents operation middleware
|
|
func (sh *strictHandler) StreamEvents(w http.ResponseWriter, r *http.Request, params StreamEventsParams) {
|
|
var request StreamEventsRequestObject
|
|
|
|
request.Params = params
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.StreamEvents(ctx, request.(StreamEventsRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "StreamEvents")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(StreamEventsResponseObject); ok {
|
|
if err := validResponse.VisitStreamEventsResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// ListExecutions operation middleware
|
|
func (sh *strictHandler) ListExecutions(w http.ResponseWriter, r *http.Request, params ListExecutionsParams) {
|
|
var request ListExecutionsRequestObject
|
|
|
|
request.Params = params
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.ListExecutions(ctx, request.(ListExecutionsRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "ListExecutions")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(ListExecutionsResponseObject); ok {
|
|
if err := validResponse.VisitListExecutionsResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// RequestExecution operation middleware
|
|
func (sh *strictHandler) RequestExecution(w http.ResponseWriter, r *http.Request, params RequestExecutionParams) {
|
|
var request RequestExecutionRequestObject
|
|
|
|
request.Params = params
|
|
|
|
var body RequestExecutionJSONRequestBody
|
|
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
|
sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err))
|
|
return
|
|
}
|
|
request.Body = &body
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.RequestExecution(ctx, request.(RequestExecutionRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "RequestExecution")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(RequestExecutionResponseObject); ok {
|
|
if err := validResponse.VisitRequestExecutionResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// GetExecution operation middleware
|
|
func (sh *strictHandler) GetExecution(w http.ResponseWriter, r *http.Request, id EntityId) {
|
|
var request GetExecutionRequestObject
|
|
|
|
request.Id = id
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.GetExecution(ctx, request.(GetExecutionRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "GetExecution")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(GetExecutionResponseObject); ok {
|
|
if err := validResponse.VisitGetExecutionResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// CancelExecution operation middleware
|
|
func (sh *strictHandler) CancelExecution(w http.ResponseWriter, r *http.Request, id EntityId) {
|
|
var request CancelExecutionRequestObject
|
|
|
|
request.Id = id
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.CancelExecution(ctx, request.(CancelExecutionRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "CancelExecution")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(CancelExecutionResponseObject); ok {
|
|
if err := validResponse.VisitCancelExecutionResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// ExportSeeds operation middleware
|
|
func (sh *strictHandler) ExportSeeds(w http.ResponseWriter, r *http.Request) {
|
|
var request ExportSeedsRequestObject
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.ExportSeeds(ctx, request.(ExportSeedsRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "ExportSeeds")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(ExportSeedsResponseObject); ok {
|
|
if err := validResponse.VisitExportSeedsResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// GetGraph operation middleware
|
|
func (sh *strictHandler) GetGraph(w http.ResponseWriter, r *http.Request, params GetGraphParams) {
|
|
var request GetGraphRequestObject
|
|
|
|
request.Params = params
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.GetGraph(ctx, request.(GetGraphRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "GetGraph")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(GetGraphResponseObject); ok {
|
|
if err := validResponse.VisitGetGraphResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// GetFleetHealth operation middleware
|
|
func (sh *strictHandler) GetFleetHealth(w http.ResponseWriter, r *http.Request) {
|
|
var request GetFleetHealthRequestObject
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.GetFleetHealth(ctx, request.(GetFleetHealthRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "GetFleetHealth")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(GetFleetHealthResponseObject); ok {
|
|
if err := validResponse.VisitGetFleetHealthResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// SearchKnowledge operation middleware
|
|
func (sh *strictHandler) SearchKnowledge(w http.ResponseWriter, r *http.Request, params SearchKnowledgeParams) {
|
|
var request SearchKnowledgeRequestObject
|
|
|
|
request.Params = params
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.SearchKnowledge(ctx, request.(SearchKnowledgeRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "SearchKnowledge")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(SearchKnowledgeResponseObject); ok {
|
|
if err := validResponse.VisitSearchKnowledgeResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// GetEntityKnowledge operation middleware
|
|
func (sh *strictHandler) GetEntityKnowledge(w http.ResponseWriter, r *http.Request, entityId string) {
|
|
var request GetEntityKnowledgeRequestObject
|
|
|
|
request.EntityId = entityId
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.GetEntityKnowledge(ctx, request.(GetEntityKnowledgeRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "GetEntityKnowledge")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(GetEntityKnowledgeResponseObject); ok {
|
|
if err := validResponse.VisitGetEntityKnowledgeResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// QueryMetrics operation middleware
|
|
func (sh *strictHandler) QueryMetrics(w http.ResponseWriter, r *http.Request, params QueryMetricsParams) {
|
|
var request QueryMetricsRequestObject
|
|
|
|
request.Params = params
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.QueryMetrics(ctx, request.(QueryMetricsRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "QueryMetrics")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(QueryMetricsResponseObject); ok {
|
|
if err := validResponse.VisitQueryMetricsResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// GetOntology operation middleware
|
|
func (sh *strictHandler) GetOntology(w http.ResponseWriter, r *http.Request) {
|
|
var request GetOntologyRequestObject
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.GetOntology(ctx, request.(GetOntologyRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "GetOntology")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(GetOntologyResponseObject); ok {
|
|
if err := validResponse.VisitGetOntologyResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// CreateEntityType operation middleware
|
|
func (sh *strictHandler) CreateEntityType(w http.ResponseWriter, r *http.Request, params CreateEntityTypeParams) {
|
|
var request CreateEntityTypeRequestObject
|
|
|
|
request.Params = params
|
|
|
|
var body CreateEntityTypeJSONRequestBody
|
|
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
|
sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err))
|
|
return
|
|
}
|
|
request.Body = &body
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.CreateEntityType(ctx, request.(CreateEntityTypeRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "CreateEntityType")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(CreateEntityTypeResponseObject); ok {
|
|
if err := validResponse.VisitCreateEntityTypeResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// PatchEntityType operation middleware
|
|
func (sh *strictHandler) PatchEntityType(w http.ResponseWriter, r *http.Request, name string, params PatchEntityTypeParams) {
|
|
var request PatchEntityTypeRequestObject
|
|
|
|
request.Name = name
|
|
request.Params = params
|
|
|
|
var body PatchEntityTypeJSONRequestBody
|
|
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
|
sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err))
|
|
return
|
|
}
|
|
request.Body = &body
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.PatchEntityType(ctx, request.(PatchEntityTypeRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "PatchEntityType")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(PatchEntityTypeResponseObject); ok {
|
|
if err := validResponse.VisitPatchEntityTypeResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// ListPatterns operation middleware
|
|
func (sh *strictHandler) ListPatterns(w http.ResponseWriter, r *http.Request, params ListPatternsParams) {
|
|
var request ListPatternsRequestObject
|
|
|
|
request.Params = params
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.ListPatterns(ctx, request.(ListPatternsRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "ListPatterns")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(ListPatternsResponseObject); ok {
|
|
if err := validResponse.VisitListPatternsResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// PatchPattern operation middleware
|
|
func (sh *strictHandler) PatchPattern(w http.ResponseWriter, r *http.Request, id EntityId, params PatchPatternParams) {
|
|
var request PatchPatternRequestObject
|
|
|
|
request.Id = id
|
|
request.Params = params
|
|
|
|
var body PatchPatternJSONRequestBody
|
|
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
|
sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err))
|
|
return
|
|
}
|
|
request.Body = &body
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.PatchPattern(ctx, request.(PatchPatternRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "PatchPattern")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(PatchPatternResponseObject); ok {
|
|
if err := validResponse.VisitPatchPatternResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// ListApprovalRules operation middleware
|
|
func (sh *strictHandler) ListApprovalRules(w http.ResponseWriter, r *http.Request) {
|
|
var request ListApprovalRulesRequestObject
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.ListApprovalRules(ctx, request.(ListApprovalRulesRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "ListApprovalRules")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(ListApprovalRulesResponseObject); ok {
|
|
if err := validResponse.VisitListApprovalRulesResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// CreateApprovalRule operation middleware
|
|
func (sh *strictHandler) CreateApprovalRule(w http.ResponseWriter, r *http.Request, params CreateApprovalRuleParams) {
|
|
var request CreateApprovalRuleRequestObject
|
|
|
|
request.Params = params
|
|
|
|
var body CreateApprovalRuleJSONRequestBody
|
|
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
|
sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err))
|
|
return
|
|
}
|
|
request.Body = &body
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.CreateApprovalRule(ctx, request.(CreateApprovalRuleRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "CreateApprovalRule")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(CreateApprovalRuleResponseObject); ok {
|
|
if err := validResponse.VisitCreateApprovalRuleResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// PatchApprovalRule operation middleware
|
|
func (sh *strictHandler) PatchApprovalRule(w http.ResponseWriter, r *http.Request, id EntityId, params PatchApprovalRuleParams) {
|
|
var request PatchApprovalRuleRequestObject
|
|
|
|
request.Id = id
|
|
request.Params = params
|
|
|
|
var body PatchApprovalRuleJSONRequestBody
|
|
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
|
sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err))
|
|
return
|
|
}
|
|
request.Body = &body
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.PatchApprovalRule(ctx, request.(PatchApprovalRuleRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "PatchApprovalRule")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(PatchApprovalRuleResponseObject); ok {
|
|
if err := validResponse.VisitPatchApprovalRuleResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// GetAutonomySettings operation middleware
|
|
func (sh *strictHandler) GetAutonomySettings(w http.ResponseWriter, r *http.Request) {
|
|
var request GetAutonomySettingsRequestObject
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.GetAutonomySettings(ctx, request.(GetAutonomySettingsRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "GetAutonomySettings")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(GetAutonomySettingsResponseObject); ok {
|
|
if err := validResponse.VisitGetAutonomySettingsResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// PatchAutonomySettings operation middleware
|
|
func (sh *strictHandler) PatchAutonomySettings(w http.ResponseWriter, r *http.Request) {
|
|
var request PatchAutonomySettingsRequestObject
|
|
|
|
var body PatchAutonomySettingsJSONRequestBody
|
|
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
|
sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err))
|
|
return
|
|
}
|
|
request.Body = &body
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.PatchAutonomySettings(ctx, request.(PatchAutonomySettingsRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "PatchAutonomySettings")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(PatchAutonomySettingsResponseObject); ok {
|
|
if err := validResponse.VisitPatchAutonomySettingsResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// ListRiskClasses operation middleware
|
|
func (sh *strictHandler) ListRiskClasses(w http.ResponseWriter, r *http.Request) {
|
|
var request ListRiskClassesRequestObject
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.ListRiskClasses(ctx, request.(ListRiskClassesRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "ListRiskClasses")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(ListRiskClassesResponseObject); ok {
|
|
if err := validResponse.VisitListRiskClassesResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// EndRelationship operation middleware
|
|
func (sh *strictHandler) EndRelationship(w http.ResponseWriter, r *http.Request, params EndRelationshipParams) {
|
|
var request EndRelationshipRequestObject
|
|
|
|
request.Params = params
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.EndRelationship(ctx, request.(EndRelationshipRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "EndRelationship")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(EndRelationshipResponseObject); ok {
|
|
if err := validResponse.VisitEndRelationshipResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// CreateRelationship operation middleware
|
|
func (sh *strictHandler) CreateRelationship(w http.ResponseWriter, r *http.Request, params CreateRelationshipParams) {
|
|
var request CreateRelationshipRequestObject
|
|
|
|
request.Params = params
|
|
|
|
var body CreateRelationshipJSONRequestBody
|
|
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
|
sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err))
|
|
return
|
|
}
|
|
request.Body = &body
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.CreateRelationship(ctx, request.(CreateRelationshipRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "CreateRelationship")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(CreateRelationshipResponseObject); ok {
|
|
if err := validResponse.VisitCreateRelationshipResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// ListSignals operation middleware
|
|
func (sh *strictHandler) ListSignals(w http.ResponseWriter, r *http.Request, params ListSignalsParams) {
|
|
var request ListSignalsRequestObject
|
|
|
|
request.Params = params
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.ListSignals(ctx, request.(ListSignalsRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "ListSignals")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(ListSignalsResponseObject); ok {
|
|
if err := validResponse.VisitListSignalsResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// AckSignal operation middleware
|
|
func (sh *strictHandler) AckSignal(w http.ResponseWriter, r *http.Request, id EntityId) {
|
|
var request AckSignalRequestObject
|
|
|
|
request.Id = id
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.AckSignal(ctx, request.(AckSignalRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "AckSignal")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(AckSignalResponseObject); ok {
|
|
if err := validResponse.VisitAckSignalResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// MuteSignal operation middleware
|
|
func (sh *strictHandler) MuteSignal(w http.ResponseWriter, r *http.Request, id EntityId) {
|
|
var request MuteSignalRequestObject
|
|
|
|
request.Id = id
|
|
|
|
var body MuteSignalJSONRequestBody
|
|
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
|
sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err))
|
|
return
|
|
}
|
|
request.Body = &body
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.MuteSignal(ctx, request.(MuteSignalRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "MuteSignal")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(MuteSignalResponseObject); ok {
|
|
if err := validResponse.VisitMuteSignalResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// ResolveSignal operation middleware
|
|
func (sh *strictHandler) ResolveSignal(w http.ResponseWriter, r *http.Request, id EntityId) {
|
|
var request ResolveSignalRequestObject
|
|
|
|
request.Id = id
|
|
|
|
var body ResolveSignalJSONRequestBody
|
|
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
|
sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err))
|
|
return
|
|
}
|
|
request.Body = &body
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.ResolveSignal(ctx, request.(ResolveSignalRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "ResolveSignal")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(ResolveSignalResponseObject); ok {
|
|
if err := validResponse.VisitResolveSignalResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// ListSkills operation middleware
|
|
func (sh *strictHandler) ListSkills(w http.ResponseWriter, r *http.Request, params ListSkillsParams) {
|
|
var request ListSkillsRequestObject
|
|
|
|
request.Params = params
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.ListSkills(ctx, request.(ListSkillsRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "ListSkills")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(ListSkillsResponseObject); ok {
|
|
if err := validResponse.VisitListSkillsResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// PatchSkill operation middleware
|
|
func (sh *strictHandler) PatchSkill(w http.ResponseWriter, r *http.Request, id EntityId, params PatchSkillParams) {
|
|
var request PatchSkillRequestObject
|
|
|
|
request.Id = id
|
|
request.Params = params
|
|
|
|
var body PatchSkillJSONRequestBody
|
|
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
|
sh.options.RequestErrorHandlerFunc(w, r, fmt.Errorf("can't decode JSON body: %w", err))
|
|
return
|
|
}
|
|
request.Body = &body
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.PatchSkill(ctx, request.(PatchSkillRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "PatchSkill")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(PatchSkillResponseObject); ok {
|
|
if err := validResponse.VisitPatchSkillResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// ListSkillVersions operation middleware
|
|
func (sh *strictHandler) ListSkillVersions(w http.ResponseWriter, r *http.Request, id EntityId) {
|
|
var request ListSkillVersionsRequestObject
|
|
|
|
request.Id = id
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.ListSkillVersions(ctx, request.(ListSkillVersionsRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "ListSkillVersions")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(ListSkillVersionsResponseObject); ok {
|
|
if err := validResponse.VisitListSkillVersionsResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// GetTrends operation middleware
|
|
func (sh *strictHandler) GetTrends(w http.ResponseWriter, r *http.Request, entityId string, params GetTrendsParams) {
|
|
var request GetTrendsRequestObject
|
|
|
|
request.EntityId = entityId
|
|
request.Params = params
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.GetTrends(ctx, request.(GetTrendsRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "GetTrends")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(GetTrendsResponseObject); ok {
|
|
if err := validResponse.VisitGetTrendsResponse(w); err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
}
|
|
} else if response != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response))
|
|
}
|
|
}
|
|
|
|
// Base64 encoded, gzipped, json marshaled Swagger object
|
|
var swaggerSpec = []string{
|
|
|
|
"H4sIAAAAAAAC/+x923LbOLbor6ziOVUjzUiWk3RPn3ae3I47yUwy8Ynds2tXOyVD5JKEMQkwAChH43LV",
|
|
"fjofcGp/4XzJLlx4k0CKujhOd81LYpsgCKwb1h33QciTlDNkSgYn98EcSYTC/Hh+RWb6/whlKGiqKGfB",
|
|
"SfARJc9EiLBAISlnMOUC3k6H74kK58EgkOEcE6LfU8sUg5NAKkHZLHh4eBgEKREkQeU+cJYJycX6Jz6k",
|
|
"5HOGEJrHMBU8AQKpwAXlmQSBMuVM4h8kMPyixnZYMAiofvdzhmIZDAJGEv3x4mHzsgbBOVNULd9G6yv5",
|
|
"5Ze3r4ALkHE2gx4ezY7gZs6lOplnE0HlTT//bErUvPwqjYJBIPBzRgVGwYkSGbav4GfBkyuq3733bkPD",
|
|
"oLaJKRcJUcFJEBGFQ6VfHXjmfRthknKFLFz+FZfr+zuLKTI1nCFDQRRGcIvLlyAwjclSwh1Vc8rg+Xdz",
|
|
"EKgywUDNEbigM8pIXCAih4ElnXLRlY8P9der60/Il3fIZmoenDx7/n+8S59ailpbsybLkigoF/D6/Ool",
|
|
"fPfsOXBWUGVCZeIo0r+4kmK3QdQ7mlDVhKXYPKxOEOGUZLEKTr4/Hug90yRLgpPnx/o3yuxvz4rdU6Zw",
|
|
"hsJ86Iq30YPi21PDg96pxZjhvgtkEWWz0zQVfEFi/aeQM4XM7I+kaUxDomE++ofUgL+vfPB/C5wGJ8H/",
|
|
"GpXCY2SfylExofnkCr3NCZshSEVmGL0EAgkqMiTuDbgjEkKBhhJ7UUbioV6R4HE/eBgEF4JPYkxaFpra",
|
|
"EX/absH5vJ71ngvBBfQ+/nwGP373/Q9mGZd0xkj8S6phHR0ManZW3xrcl0DmI3LMGyyezpCp01DRBVWG",
|
|
"wVPBUxSKWiQT92RsqeE+QKZp7tdAcR6PQxLHhgGI5ExTif52SDUDBYMgCdNxTncoQxKbfQWf1khrEBC9",
|
|
"ijGNPEwzCEIuBNqX3RCWxTGZxJhz3NorUSbs+ES2jC/4ZRCgEeFdp68ttDILZWmmxjJLEiKWnWbimdr2",
|
|
"FYlSbgEKmYUhyjYwTDiPkTA9WPFbZOOQZ5YcN8PNkIEVKh3WYlWEjmdPKVZ/tQeikkGFUgYrtFmSFZ/8",
|
|
"A0Olv1eVTet0bdlrndysABkT1XWxluqj9nc206ybY9KNDPBLSgXKrZZpSaYYm2UWrqvDbimLqryOXzDM",
|
|
"lGXqlMc0XA5DI4j170QpFGxokNHM4ClZxpx4NCSjE2nccIkR2NkhotNpM8hK/Aoqb8dhTCx5r5N+nM38",
|
|
"DxRRmaxuMbWHmaYqQzMYGVnGqPnBwtoqZQt+i5F3jzKzC1vXOIxwsUqg1oCK8yrkLETB5Gby8PGD2d4g",
|
|
"J+UaNBwOi53WyKVG4m1s8zGLcSvWIZnijCfLcYwLjKvw1U/KY8DwAy5QeOHoZHF+4tRh+Z4sYYJAJlIJ",
|
|
"EiroUTZHQZWEiN+xfhdG68gFm4gr5CmO7VrbUa4NnBTF0I4FvkAhaISyy1qdOuo7bnwk4aeFFbSUs25C",
|
|
"/pmhk6cngX1x085MnYDmBVUWUXXOlFhuB6JQcdH1+LaDV7UvcwoGg0B/kShroC6lwtzIi7K4AbK7KFOo",
|
|
"CI0rWykhcBi1KUE1592mMHZyJ7XHOBnGNO022ojJccgj7Kj3HECTKTFbMK6fyiwhXqJSesY1Uru1ljl+",
|
|
"IUmq1xzMYj4h8ZGm4DEJlU+4ZdYo2Ep7WJA487Njdyl1a+x4O1O7HDqbY3i7vtmQsyn1uJX+TmJq7Rwt",
|
|
"at3p56FXjdYqGVaU347ngt6aWJB4LP3UvKo9zZVK9Tyh/jei8lYfwCjU0BzJGhyRoFNj98v50O7Jr180",
|
|
"qTOKiBlu0Dt6lElFWIhDIxyjTielnbjhJHaz64fQ0/9uNTNNkGvDxw/DFoIaBP/krIu50aIyOfKoYLK6",
|
|
"opJMOlBo0xFZ0mkbERb+nSaDrE5sxfA/Hx8PvjHS20Q87SRQ7OyZd2M5yttRXMVuI8Iucq/gLvjahCDP",
|
|
"QdFG6A++RWr9g06dF2g33SvMZefakElMpBoLElFr/1CFiV+Hcn8gQpClX3E4iOXcUeg6M3Ns0BQhC9sk",
|
|
"AMuSiYV+6ZnyIVZgyJMEmbHcC7Dua3UKnilcVXyH9hyuKL9zHjeYkcZP19m9c0vjzoNLbt1BdvrVZLvb",
|
|
"ug9whVQ22pvnhaK+QupKCTrJFEov+h6R3BKieZTp83KcMWW1393cOrlzrFGmlnpbJTIUNCipHf1sTTJ3",
|
|
"J7VvOxPUCWGn15rdl3PUkFZbTjNdNBqhNepo0gbJjGjNx/hd9Af+IKF4cexc655Pb8RaM3bqK3llDzYJ",
|
|
"ips1xHSK4TKM9ULcoTe2r7bgccUFkkllfCDAOBsWnhAs9bGNVogHSc0IuPDH0U4VxEikAs4Q+NTsbkox",
|
|
"jiQkboWpQIlMHQWDLXD3HoUJ7izWcNgFcV+Fc/2ovjLStcQwmHHQU4IwSfWgck99L4oaEHDlyKABhuNq",
|
|
"vLC6oL9cfvgbXOag2niu1V72bDviGrjeR1SOczr0q0kxWaKoHooJKmJU8KkgUoksVJnQWJnxBQqDPnOQ",
|
|
"zBht9CkXgO56/DUiNCUCWamqbj50DUzHrVbKuo/ZuMjR+JVTgaEJ/33aS+A66eoQk0O5jo5iJZ9a6Wuj",
|
|
"lB2vhbUfg3IKO2BKYum1iNYo6ZAktDPJtItbP57aEdJgpxwEH7vSpldELVzsetWe2t7PSBR5RC+jxAUK",
|
|
"p2dWaIcHg+COiFx1FVTRkMR+zdz4FP3WkuyuUBXO3ELxsyr/kSBUYrSFC9Gd38XOiiV6SauI4m1lU1Yi",
|
|
"85ud1S520HV8WLN1O7/FNdjUnuHWR7Jnt8486GwAC5J4tKVLbf+BfQq9dZ3JPnHCou/TmARKI3H3t3wf",
|
|
"0XK1gysn42bAtmnqYl/q8USQXQy7HkK2PvjWkLKLrhvxo/l4uqz8bAdPCbXuSL28aMwzE8TVJ1xs/y64",
|
|
"/mE8IeGt+03/OHbvfdrHFVBZiEez2zouXQSkt3YS5OLrI37OUKo2KVZKVoEG2+0c5WEJIpuOziqNr7Ci",
|
|
"eQRqThQk3KRDYARqTiX0uBlE4n4w2Np/X00i3Xg4uLlaI0qvBUnnf6d4tw5DjGZYdwy2JZ19dAiUc5r6",
|
|
"fIaMR1vM5txAnnmUyFiYp8utGF0iQ6BT0J+CkKQmB3BOKxhvolW7uIHbsg9Ob5DEan5Z5matwEqvl65s",
|
|
"sD5kbmaoueTNX4zrHWeCRFYq8DvNKBm7Zfonr6ZKpLJ+3f3kVqMjX2A9dkATLbTypD69VPuzVOYDtdXu",
|
|
"6pBq9Uo42PkQs0ofsglFBYy9GqEBu/dJjiXvw3zjm+2z7ZCd728VKm5zg5LgfDD5K+N3sablN9QjGztq",
|
|
"GTFltxiNvZS9MUIgCLvt5JVvPpkZTVOfJHxDZ/OYzuZaoJq0bDBJs19UJ5q3qQCdUwcUVTG27LjkkYiH",
|
|
"WWIzMUTGJpzfGpfGAqWis6ZkuM1OU7sAH5Lf5fbqKy1G16m96k/0WttRs0NrS2wrFAnVR+FOLxcuMY9K",
|
|
"ez8VPDmBe8VP4N6BSp7Ar9qKjoZGBg7g6Ojo08PDQ7CJe2ieBWdk/ZrHtbIOH7zfoxI0vEThIOw5AJZN",
|
|
"1kNi3m0IEcVxllYpSZC7YBA8m+t/GsJCRqVpO2zIYtaJ/bZI703Il05TJpR1GreNmVykm6zUD5E7sLCA",
|
|
"PI1kw2dXNSTZ6UwpDsQ2leXKDFr9QkkXBRUUOC8R6VvEhQ1zbmehp2lMUTYH2usx0zo0/4PGkjOI+R0K",
|
|
"mPCMRQOtRaUYwWQJuLDv2Yzw0feBB6X1Mf4TU9shmWgd0vWA0mpQYeXupQqlJazXnn3OiCBMUdYU9t8i",
|
|
"tXi+TLmao6T/tBkl+eLzDPYVr5s5QIoxn5oz+tuguVvMrkZJFQMuh1SNlNYwX7Ht2rJmKlU4q6fXSpph",
|
|
"JR1UCC48J8XPFONoaBI089AK5QzscOh99/y5KbDzi0sTq/KL5ybzbwV2doZifBepkmdhbaAdXx7JJqWk",
|
|
"cJ0HZMIzdTKJtT42qPCUoJvNR/OZ1phBzejbEJXd6FEqXaortnSczYBPwdWKulTeLWznfAL7vG2CJrFp",
|
|
"CGpsKie3ObNoNFZ8V6m0qvpb6AxKq96xZmVtm1DULXzeGTHtzohmfGx8r5uF6AfIJhj4A6ghEZHWYFdi",
|
|
"ApzhUPEhZ/o77peEME08+r/yWf6befjJmzjdHobRloKQuF/s0lk3naolgm1zPDe+7w90VddU/8KgBnUv",
|
|
"3qi8PctdzCskm4cXyk+WaGMOYWVGfP6jTRoTScNxWmTNkVirQQ0H/iZcNuDHD5/1jXiW4QOOq/JcJ2Xj",
|
|
"GOroS8/P7U6Dp1RINZaIbKswyDQmaZuCMudxNI74Hds3SWPbkrYy5oZiQUMcOneMX9Pcet8xvcV4OQ5J",
|
|
"1pGvk0ztnajCwzATYpMSfoD458bcp9KcdZFMEt7mfqlc4TXf0du2qpPk8aIa5Pi0yyE/xyL9aU7lYerq",
|
|
"8gq6SnDVeQ3W4L3KJivU4+XkWxrHe9l5myOcpkZzXGqzHd/oXIK6jc2WyT3NtZZMDJsaTKMtnVCp4CFG",
|
|
"mfCpn3k6SQRSYSpHNjA3yiNrozzgmsaEwccXwx/7azlu+CXFUBupRUi4qWCEaTmY28jJWsxk80aqMV5/",
|
|
"QMutu3MsxpDnpUJvWMeA5DBTWbgeYq5VTdGssfiAjwW3sOEjQaZWYCmUK7a7wKnxE1TCtBsSvHIDXrTn",
|
|
"85Y+lt3M+bXc28KgLwz1kgUaZZSBtie9J0kI88TjXnNQmKQxUWgqXV0CQuCvYHfl0quMQ1VRiudLrIt4",
|
|
"pgcwRSiTfqWre0KvQH/9ptLbUA0sG2FMlt1rOkTGWD1pTcp5MMjrc0wNCWs4dJvOvi0A7a+0+fPxYBM1",
|
|
"uXUPCnT7qOQqd5SuAJDxhMTLBm2aCiyj9TtEHNcVTq45TvqUBGqcxTFlSASkgv/DfnoAP0RgUyk2+7eb",
|
|
"ffky5j7L6Z393JQqSFFARJZbO6oL13EJLW+wUGKYaQ3FZPpa4E+QCBSnmZr7umNZs2i0oHiH4gT0MK09",
|
|
"3cKHt6/O4C//cVVNJKJseHrxFv71X/8NZySKltdsysUdEdGQZGoO1KSxI5M4pGwYYarmA2DcJtw7743W",
|
|
"0ESm5v2ja2b6zZyY1Ggagl0nmLYjtifTWzalUmug0DPlhHBjMtBu9Lt5zyJDTObNktoNK5nuN0andW11",
|
|
"XFap63oUKS54sN5UyPYIGuqzHEFvdsqFWf8HesslzHmCMZnAh8sjuNLq5ZTGqDeuh/zxj8Umr5nZ5R//",
|
|
"CD3TdoiEamj0wv4JvOagDQ4UIFU2kUAEQtk1646qOXCS0qEWezNkg2sWmtZaEnr558/evR3ANNNaCfzy",
|
|
"VvYtvAyYSYIgUwyPrtk1O+NsodHJWUU/edE/uWZDOLeeUf31vCcR3DR1QLo50q+8o1JJyCTCzb05owfV",
|
|
"tmkPN3bxrtdaSmaUWSdszwkaMF2t4PvjASTkCzw/Pu6beX9hkkwRLj5cXkkgYYipgpuVll830LPNw9KY",
|
|
"LOGOsojf2bffZ0YogHDd5CSERIgl3LjT7uYlvD6/cm3HJNycX5HZzQAuTq/O3kAeU4SbvIvXDfRc/6+8",
|
|
"75f9zBVNUCqSpCXMXrx48SP8cnVmnp+7QLl5SqJIoJRmXZN62g706m3fDKKu5gjvzy7AiP8pCRF6Ugkk",
|
|
"iZnhzdXVxQD4dEpDSmJNQJev/trXZJdomwMjIApuRkmY3lwzzkpCmFBGxBIIi/RgninjRzW8ZOlas6wL",
|
|
"XL8EakpTeCzhTpD0mpX0ZO1jMLnKQAy1S21mRSmnTEnLjzENNe9XmOxCmMQnLa5F7BhTnoxGzvI+ctGN",
|
|
"UerGlb7twLLb6cXbitZyEjw7Oj46NmZuioykNDgJXhwdH72wgYm5kXcjIySGpNLHyh2a1glEOXsbBSfB",
|
|
"/81QLOstr+pNBX/190urdB1q6e7W8G6tTdEOE1TDia0v+zTncnOjoklgh7GufVyHka4JY4eRtvfdw6eV",
|
|
"PnLPj4+36oK2ktiSmw2d7Ic66n0Za5WOkNuXSZoleM7otSMnXwIgUya34GFQKmb+LRQwq/Sbq2Q+2UZu",
|
|
"MME5WVAuIObGzU5m0vi0J5qdyYTmbtcvw3zhtmo/OAmsOmBmHeUOStnISfpYOC1GdWKiwuoocXm49ktN",
|
|
"zJN7cdY+uXdTq98dbxR9F5+OLQqC2p8fNIECqVBozgsF4uU2jDC6p9HDqOhuqGFdp/gNCC56xGocp1x6",
|
|
"WOqVaQBXoGGw5RdWerVaWjKp0j/xaLkHGVU3XdQLWTa1XLosONNrmjGuOoRGiq/4CaXeZPVhTz7Ztf/o",
|
|
"K7dIEBhyEWF0CMFtQalVRQ1L6EnKZjEOtcptDaM8Ad+ZEENJI+xvQ9FFUMzSdBbZFNEWFckM6aYaVdsY",
|
|
"7aIc2V5Yj6kXNWllnO3y5lrhwr91sv3OnbKL2hOePHoRuTYGPSXh1fnlWf8Q7G1m3l4dq/OsCfC2a2Nn",
|
|
"dkgnpl3TijrSfpF2sQOz5i2V1l6tFGj8vijbtjB7OqJ2FHEgXcqQIEQ4pcxlTJcEbauiNilUTYqPTVGy",
|
|
"0HpCrWcjKl0qVSd95NlhP+1Fry2YOwB+7UxAHI57VtoMiRxGRJEB5F7EH/qdce4TX0aH3ld1zsvi6yRk",
|
|
"quV3pCB3UcCjko6t5v/Kmmwj5eTN5/enHDuT0V2p9Xw6ItqVUGoV4RsOvJWx3ZwQRf3m19Y4805Z666I",
|
|
"rRqE/e4OyXq/uyc8LVfI6QBi1c2I2rKzhqPWLecILtmPZ3KYPwFjloEShMb9Xd0V1cK9Rr7JgxbrDLOa",
|
|
"XR8rFKYOpNrqk7IwziKUoEcjiwhTst9wfc6uZmGeabX1i0WLla3fzHvntL64ElnOJvahq0nkzAR7Ri7x",
|
|
"wveVz3vai78p1m4u6P5KLO0K6GMq1aG0YCyZp+DQSlnuztrveV6g8E2qv7VOfF9Z/82pqFkBHvhuHfNN",
|
|
"6YaNzBg34UEUZ1YpMOlGFXW1Jx9caMhe4f0aVUEmj6Y0NoPbcZOr03o6oL8u6nlWw+w7MeUBbJHV1J+8",
|
|
"AWClvNhkCCza2lKWvcginL68ZjSOcUbi2iTuGrXvjn/U57CZblg+7x/BhY1kzfRHrpl1ckpIyLJ89QX0",
|
|
"8qhGAReXXeOxqXaVS49sVFU7U35lq6qZQfKbtgpZ8FQc4qyyssRLM0ilDeVKi8qDSK2RaS09LFtLN4mw",
|
|
"n/S4j3ZYJ5PNJJX5r8V7UbkV73tPOuNjaz+rgbLUJtw13S/WmbR89eQ2r7hTR5Td3eDTqclZL9Qcm901",
|
|
"EySdawvf1q7uT6Bl3lT+QTq1mUlOsE8JjeVXFefrBJ1HeeTmA7koNuxG0QLjnSNmZTKolyOCCTfMUlQz",
|
|
"mgRXYxKZJx6HwlOaCO0dpHam4+q0h7DkXxmgg6hOC3xaKn7Q09CFAjmy//WJd5Hfwdsc1z23YzoR6aOn",
|
|
"q3kN/0q11b8Ds09svpvOrk9ovS9sAvQBg7FvqFRcmPRyzFlh1xw5O8HIpuxW2G7FR2RTNi6RKbAbOoJz",
|
|
"Es7t9/8g4YZGN3kyufkbCH4HNIKeQJkleM3MEXzzTmtXZobh21c3/QHcmNEr72qgDuAmIooUT/5y+eFv",
|
|
"18y8ChbaR/AGiVATJArsFRhK6gnEEp59L4/gJ5RqiNMpFwoijKl58q//+u9rZlrEuEuWZDbRO52ggEk2",
|
|
"naIYQCR4OuRxhFK53POLP/dfmuzx1+dX4GB2zRSHCQlvpzSOfZbHpYFpk7Bq9FIWEIBU4JR+2dcpuXrn",
|
|
"cw0FrTNsZluFX5QFx7CkoNa7z1fo6vIc3IuH8GwtcgKyc0Lv8vK8vw9zlF7rVld0OWzXFNJHz1z4RjKF",
|
|
"fltHR5Fc+4THR0lbh/L9Vql16/hM6f9d6WA6R5gTFsUoIA9/opXcPatLDcDSYH9gY6vS3ZM7yntGDK4Z",
|
|
"YREgVXMUgOxzhpmbolge9GyY0eVX94ELd1e6BMKuWXEprXPXmAKSvH6mPhNlcJO3O76xLoSja3YaSw74",
|
|
"xV7k6247MXUTIHiMpoDMWHjuVPrwt3f/CXdkacdIvUXfUeC6/Z5Xs7W/SQ/5anvir+0lLzmuhRXK2/ET",
|
|
"29nFJd4XidKHULI+FgRUpT5H2kv41//7/5UbkE3Cif6To9qtQp/2GtSVA2ezD71CS4/nJeyEj0O4UgoQ",
|
|
"28MR/gSuo/tuMmovE7SOhJFtUf4oyfJnZuqnR+VZ0YX9ANEkMxeQ4j70UdEbHqrlKjvmfWvZLJoTv8/N",
|
|
"40vESAaHVR1MPSoXnmuy//P0/TuodNFdb23DFI/5bJdX7Rm59Ysr+kaxgEFlH8XkXfQQDVGYZPqAP4hw",
|
|
"zcuGQeqJ9W6kLQW2TWkUvPopv3nq1UcYgaukNB2TBa/llrg7o7sQj3EBt0lV01R+k7F2qYgogne9auiu",
|
|
"/xJ4QpUpUb2ba4XBOp17thtpU4KJ4Hwnpb4lpvB8Q0xhYFq7xKY/hdVYO7t4u7d0kWppSmKnXCT7q/Jt",
|
|
"0q28DMBDu+YhLMzTvUn3MptYnGocL6jMSEz/6YrFTTN++BOYZvw7+E41iZbN9pto9OcYUdmu/o95YNTv",
|
|
"DfCA1Q6AHDT7g9ZsDOa1aW3oxrQxBsoivRUu9nF4FZ28RhKJCJshfWkeFw3pu5n2n4NVdXk/e/kbsIJr",
|
|
"LfkPF9x4Q9UhTNqfszgeKvyiwKLTdpEpkFyGAHv5YSkH4Nrc11i0eGUrGrov4gQdEl6qtPR7Q+c7c+dC",
|
|
"CfhD1BzFcaHhyFGOM7C3O2jb3Jew1BWNfm42tyt4Y0DdmdrYELbrzYY41ns3qJNk6RyQ6nCsFz159j/U",
|
|
"G9PE8z7xnuAuyRSvBHfrtwbYHqK7pYzvEu56StFau5jhcLxopwWJB2rKYIgVFE1waOeEpKDcXY/hqknU",
|
|
"JDU/lFbLAVHkGElDcdskYNOB2cMSRSZS9wlrd6D4rqGpBOm3XOtaz+hNlFWDiPfTtS12IcECdYc54SEn",
|
|
"F+OArSTy68O8stz8b5XVVkg0X1N36rS5NMthgQC/87uarwjEdG6d0tk4yZQzDAoXteYcMiwch3dzZFCm",
|
|
"L675jatZ1VfWDvuGM6srN/A+SXa1JfbWEsPnx8870KF1J1dbiezt3lTagFFzLCnZGDYEGN6tXnrejV7r",
|
|
"ng0vxY7u9XHsK1b0aDuu3mMLRacxd/gNERFEGKMyHeYYVyCzNOXCtImbm8Zz7goJCfiFSmX4umg4ap4i",
|
|
"iVz0/dULD2tU8np344yvkttb3oH8JPm9TRxRKZ18Io6olFwWWC/z0PbhBNf2qD1kf5EP2kb33qM9yI6x",
|
|
"926ZAr+nmHt+d9TTRdwL0jhQvD0tSS2n5xhdq/rNmkj+9kGrzv2tVEGSKaolLEi8QCd6L1//0D+C06KD",
|
|
"mBbnaVXbWVN1Lr9rEtYXxQVMX19S10myoZdTlxuz1ppq73sT1sMTN4oqGO5bPCWuymoPkjMS9FxDO4QR",
|
|
"lLCFUXmS9Lvz2srZ4TJSisqiLMZu3QM/ZjHK4BtofKcXcsgcdLOvAzeyA5HVTbMyELlD6tFZYVzVOiAW",
|
|
"X3tp9G79SXC3TwBn8RLIVKGAnADKxTnJ96LRHquB+hu1yKpr3MYmexI2v7CZAs4aqlEJ9KKMxENP2LeV",
|
|
"Zjqw9WP3cdmPSh7ZOvmNkoehCMfehyQMl4HY5ow8dWMuUSnKZk8r6+trOaC4L3Z3iJZxdpEg3ZzQu6Vx",
|
|
"PJR3VIXzATBcoBjmXWNMe4P+DkeCX6f9SKg0GYH5IqiEKr3EGEHv+fFz+FOZNHgE7/gdmk4YVNlCAbd0",
|
|
"uJnFfELiIz3dmITqBK4DPp1eBzfagiWRzT60Wxrng+AWXb1BfuzQJMGIEoXxUn/9uH9ijqYKWCDJpLLz",
|
|
"wB1xmSSEFYtsrHD2kuduckNvRz8i8UWNRpsiQ4+nt36bPHJqsGlLW5SgNqn5CZXkQjzmtG4FpKxLyJc1",
|
|
"Mvvw88+aJQqC3E9+CipvhyY1doO2XFyL+LS6cnk74wEVZSpvIYfBgfRlUZ1zS9Go0VOr9LRCMkZr+q5k",
|
|
"TbKoVsParYwlv8Z0q4SX1rKWvWeqJKxt5cheIcXvPCdKNcyE7DBdk89ZpLWa6tQ9iUpCfgWvtV1MJguV",
|
|
"cIupPRHmpgJw2d+l50GTGXXu7sSwMTRPl4/1uCD05hQFEeF8OSR3RGD/JVRuRgVkUy5CjJoMqXaa+zYM",
|
|
"Kc8txF85uFWvLv8qHTRrFOkylnZqrpF3TWw7FC7dmM61c3iwmuxdbhB9lIrxLq2Mf09ufncF8NN5+XOi",
|
|
"O9BJLQsa3q6ZcIVHbLGJu97y4JUmp+Gtg7kf6+07t68eruHqaXmhLhAHvB17rdagl2TukvhDg+99prAC",
|
|
"v0MEITrcmbzjJRSVmfe4huLrUoQGcEEK1uqFq6t3hyAKdzvzo9DFRzv3gUmjGc1ryPwmkOegUOIvISwj",
|
|
"cbzcFX3aVN2gNNgh3S73yO+c5v+O3j/ysW7uA3/CU91SxaEOdTMb9GKiUKqiBC1FYR/1dwvp22kfO/xg",
|
|
"UfENx9pTyhhG45ZboX3h9vWbq1uvqX7q6LpjiG8+tm5oEriAlOpfy9u2dwqjVyh85KbqIM3/no/89gTY",
|
|
"zgKp2NP++HJT5b4f07jN4m17MbRnhbwpx5Ndi5/M1dpya1H0WyvmsDeIH450HNgOwejIIiCMxEtJpdWt",
|
|
"4ziv4QDN/55Cqm0KOh6zmKpyNbiZunop+K+fNMbtfXL2w/a23hFJ6WjxzNCD28+qt/NtXgbvKrSLugLT",
|
|
"z9M0jan6zuvbsGU19/7O0l3LEtyEvKyUuPf7KMxyXMucnkWLidfU7gLxLqjorDCAlStJBuWlktCLzJWN",
|
|
"IxKqyrRYbTx035AjaZZWqEla9lRmKGTR+vvVYMlgJS1oUASyyqlcxGN9oqKa0aHR1fSWfrVKPeK9t0xK",
|
|
"Dmx1sfluRNXA9dQbuELkCqZqHOEDd8qFWn/P9Sd4+PTwPwEAAP//RbUORWfKAAA=",
|
|
}
|
|
|
|
// GetSwagger returns the content of the embedded swagger specification file
|
|
// or error if failed to decode
|
|
func decodeSpec() ([]byte, error) {
|
|
zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, ""))
|
|
if err != nil {
|
|
return nil, fmt.Errorf("error base64 decoding spec: %w", err)
|
|
}
|
|
zr, err := gzip.NewReader(bytes.NewReader(zipped))
|
|
if err != nil {
|
|
return nil, fmt.Errorf("error decompressing spec: %w", err)
|
|
}
|
|
var buf bytes.Buffer
|
|
_, err = buf.ReadFrom(zr)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("error decompressing spec: %w", err)
|
|
}
|
|
|
|
return buf.Bytes(), nil
|
|
}
|
|
|
|
var rawSpec = decodeSpecCached()
|
|
|
|
// a naive cached of a decoded swagger spec
|
|
func decodeSpecCached() func() ([]byte, error) {
|
|
data, err := decodeSpec()
|
|
return func() ([]byte, error) {
|
|
return data, err
|
|
}
|
|
}
|
|
|
|
// Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
|
|
func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) {
|
|
res := make(map[string]func() ([]byte, error))
|
|
if len(pathToFile) > 0 {
|
|
res[pathToFile] = rawSpec
|
|
}
|
|
|
|
return res
|
|
}
|
|
|
|
// GetSwagger returns the Swagger specification corresponding to the generated code
|
|
// in this file. The external references of Swagger specification are resolved.
|
|
// The logic of resolving external references is tightly connected to "import-mapping" feature.
|
|
// Externally referenced files must be embedded in the corresponding golang packages.
|
|
// Urls can be supported but this task was out of the scope.
|
|
func GetSwagger() (swagger *openapi3.T, err error) {
|
|
resolvePath := PathToRawSpec("")
|
|
|
|
loader := openapi3.NewLoader()
|
|
loader.IsExternalRefsAllowed = true
|
|
loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) {
|
|
pathToFile := url.String()
|
|
pathToFile = path.Clean(pathToFile)
|
|
getSpec, ok := resolvePath[pathToFile]
|
|
if !ok {
|
|
err1 := fmt.Errorf("path not found: %s", pathToFile)
|
|
return nil, err1
|
|
}
|
|
return getSpec()
|
|
}
|
|
var specData []byte
|
|
specData, err = rawSpec()
|
|
if err != nil {
|
|
return
|
|
}
|
|
swagger, err = loader.LoadFromData(specData)
|
|
if err != nil {
|
|
return
|
|
}
|
|
return
|
|
}
|