The window rendered the same 13 collapsible sections for every entity, sorted
only by "does it have content". Audit trail carried the same visual weight as
Health, and the window answered "what data do we hold about X?" rather than
"what do I need to know, and what should I do?".
Measured against prod: host:hubris has 223 relations, 1,601 events, 2.7M metric
samples and 148 executions; an ingress route has three facts. Both got 13
identical headers. Expanding a host put ~540 interactive elements on screen.
- **A verdict header that never collapses.** Not just "down" but *why*:
"ping failing · 5 of 6 checks passing". That line did not previously exist
and could not have — checks rendered as configuration, never as results.
- **Sections composed per type.** A document has no checks, metrics or blast
radius; a signal or execution is a record, not a thing. Infrastructure gets
Status/Impact/Activity/Metrics/Reference, knowledge types lead with Content,
records get a minimal view. Unknown types fall back to infrastructure so a
new entity type is never a blank window.
- **Status replaces Monitoring**, showing each check's own verdict and when it
last ran — the section that answers the header's "why".
- **Impact** finally calls /entities/{id}/blast-radius. The endpoint has existed
since the first API and had no frontend caller anywhere, despite
.agents/OIKOS.md naming blast radius as the reason the ontology exists. Its
outgoing-edges-only limitation is stated in the UI rather than hidden.
- **Activity merges four lists** (executions, signals, events, agent activity)
that were telling one story in four places.
- **Relations cap at 8 with a drill-in** — 540 interactive elements down to 126.
- **Ask Nomos** opens a task pre-scoped to what you are looking at, seeded with
the verdict just computed, via an optional draft threaded through
openNewTaskWindow -> NewTaskChat -> ChatThread.
Requires exposing check_defs.last_health/last_run_at through the API (the
columns landed with the health-aggregation work but were never surfaced).
Adding a fourth enum containing "unknown" made oapi-codegen disambiguate all
enum constants by type prefix, so metrics.go moves to gen.TrendDirection*.
Verdict derivation and type->section composition live in $lib/entityView.ts as
pure functions with 15 unit tests, including the host:strong case that
motivated this.
Co-Authored-By: Claude <noreply@anthropic.com>
8472 lines
289 KiB
Go
8472 lines
289 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"
|
|
CheckKindPing CheckKind = "ping"
|
|
CheckKindSshScript CheckKind = "ssh-script"
|
|
CheckKindTcp CheckKind = "tcp"
|
|
)
|
|
|
|
// Defines values for CheckLastHealth.
|
|
const (
|
|
CheckLastHealthDegraded CheckLastHealth = "degraded"
|
|
CheckLastHealthDown CheckLastHealth = "down"
|
|
CheckLastHealthHealthy CheckLastHealth = "healthy"
|
|
CheckLastHealthUnknown CheckLastHealth = "unknown"
|
|
)
|
|
|
|
// Defines values for CheckCreateKind.
|
|
const (
|
|
CheckCreateKindCertExpiry CheckCreateKind = "cert-expiry"
|
|
CheckCreateKindDisk CheckCreateKind = "disk"
|
|
CheckCreateKindDrift CheckCreateKind = "drift"
|
|
CheckCreateKindHttp CheckCreateKind = "http"
|
|
CheckCreateKindPing CheckCreateKind = "ping"
|
|
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 EntityHealth.
|
|
const (
|
|
EntityHealthDegraded EntityHealth = "degraded"
|
|
EntityHealthDown EntityHealth = "down"
|
|
EntityHealthHealthy EntityHealth = "healthy"
|
|
EntityHealthStale EntityHealth = "stale"
|
|
EntityHealthUnknown EntityHealth = "unknown"
|
|
)
|
|
|
|
// 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 GraphViewHealth.
|
|
const (
|
|
GraphViewHealthDegraded GraphViewHealth = "degraded"
|
|
GraphViewHealthDown GraphViewHealth = "down"
|
|
GraphViewHealthHealthy GraphViewHealth = "healthy"
|
|
GraphViewHealthStale GraphViewHealth = "stale"
|
|
GraphViewHealthUnknown GraphViewHealth = "unknown"
|
|
)
|
|
|
|
// Defines values for HealthSummaryEntitiesHealth.
|
|
const (
|
|
HealthSummaryEntitiesHealthDegraded HealthSummaryEntitiesHealth = "degraded"
|
|
HealthSummaryEntitiesHealthDown HealthSummaryEntitiesHealth = "down"
|
|
HealthSummaryEntitiesHealthHealthy HealthSummaryEntitiesHealth = "healthy"
|
|
HealthSummaryEntitiesHealthStale HealthSummaryEntitiesHealth = "stale"
|
|
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 ProvisionStatusStepsStatus.
|
|
const (
|
|
ProvisionStatusStepsStatusFailed ProvisionStatusStepsStatus = "failed"
|
|
ProvisionStatusStepsStatusOk ProvisionStatusStepsStatus = "ok"
|
|
ProvisionStatusStepsStatusPending ProvisionStatusStepsStatus = "pending"
|
|
ProvisionStatusStepsStatusRunning ProvisionStatusStepsStatus = "running"
|
|
ProvisionStatusStepsStatusSkipped ProvisionStatusStepsStatus = "skipped"
|
|
)
|
|
|
|
// 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 (
|
|
SignalStateAcknowledged SignalState = "acknowledged"
|
|
SignalStateActing SignalState = "acting"
|
|
SignalStateFailed SignalState = "failed"
|
|
SignalStateMuted SignalState = "muted"
|
|
SignalStateRaised SignalState = "raised"
|
|
SignalStateResolved 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 (
|
|
TrendDirectionDegrading TrendDirection = "degrading"
|
|
TrendDirectionImproving TrendDirection = "improving"
|
|
TrendDirectionStable TrendDirection = "stable"
|
|
TrendDirectionUnknown 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 GetGraphParamsInclude.
|
|
const (
|
|
Status GetGraphParamsInclude = "status"
|
|
)
|
|
|
|
// 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"`
|
|
|
|
// LastHealth This check's own most recent verdict. An entity's health is the worst of these across its enabled checks, so this is what explains *why* an entity is degraded. Null until the check first runs.
|
|
LastHealth *CheckLastHealth `json:"last_health"`
|
|
|
|
// LastRunAt When this check last executed. Null = never run.
|
|
LastRunAt *time.Time `json:"last_run_at"`
|
|
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
|
|
|
|
// CheckLastHealth This check's own most recent verdict. An entity's health is the worst of these across its enabled checks, so this is what explains *why* an entity is degraded. Null until the check first runs.
|
|
type CheckLastHealth 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
|
|
|
|
// ClientContext defines model for ClientContext.
|
|
type ClientContext struct {
|
|
// AgentFilesChanged Paths of agent instruction files that changed
|
|
AgentFilesChanged *[]string `json:"agent_files_changed,omitempty"`
|
|
|
|
// Since Timestamp for the next poll request
|
|
Since *time.Time `json:"since,omitempty"`
|
|
|
|
// SopsConfigChanged True if .sops.yaml recipients changed
|
|
SopsConfigChanged *bool `json:"sops_config_changed,omitempty"`
|
|
|
|
// ToolsChanged Paths of tools/*.setup.sh that changed
|
|
ToolsChanged *[]string `json:"tools_changed,omitempty"`
|
|
|
|
// Version Monotonic context version number
|
|
Version int `json:"version"`
|
|
}
|
|
|
|
// ClientSecrets defines model for ClientSecrets.
|
|
type ClientSecrets struct {
|
|
// Keys Infisical secret keys accessible to this client
|
|
Keys []string `json:"keys"`
|
|
}
|
|
|
|
// DashboardSummary defines model for DashboardSummary.
|
|
type DashboardSummary struct {
|
|
ApprovalsPending int `json:"approvals_pending"`
|
|
|
|
// EntitiesByState entity counts keyed by state
|
|
EntitiesByState map[string]int `json:"entities_by_state"`
|
|
|
|
// EntitiesByType entity counts keyed by type
|
|
EntitiesByType map[string]int `json:"entities_by_type"`
|
|
|
|
// EventRate event counts bucketed by 5-minute interval, most recent last
|
|
EventRate []struct {
|
|
Bucket time.Time `json:"bucket"`
|
|
Count int `json:"count"`
|
|
} `json:"event_rate"`
|
|
|
|
// ExecutionsByState execution counts keyed by state, last 24h
|
|
ExecutionsByState map[string]int `json:"executions_by_state"`
|
|
Health struct {
|
|
Degraded int `json:"degraded"`
|
|
Down int `json:"down"`
|
|
Healthy int `json:"healthy"`
|
|
|
|
// Stale last observation older than the check's expected cadence
|
|
Stale *int `json:"stale,omitempty"`
|
|
Unknown int `json:"unknown"`
|
|
} `json:"health"`
|
|
|
|
// SignalsBySeverity open (non-resolved) signal counts keyed by severity
|
|
SignalsBySeverity map[string]int `json:"signals_by_severity"`
|
|
}
|
|
|
|
// EnrollRequest defines model for EnrollRequest.
|
|
type EnrollRequest struct {
|
|
// Hostname Actual hostname of the enrolling machine
|
|
Hostname *string `json:"hostname,omitempty"`
|
|
|
|
// MeshIp Source mesh IP for identity validation
|
|
MeshIp *string `json:"mesh_ip,omitempty"`
|
|
|
|
// Slug Entity slug (e.g. ws:new-laptop)
|
|
Slug string `json:"slug"`
|
|
}
|
|
|
|
// EnrollResponse defines model for EnrollResponse.
|
|
type EnrollResponse struct {
|
|
// AgePrivateKey AGE-SECRET-KEY-... for local decryption
|
|
AgePrivateKey string `json:"age_private_key"`
|
|
|
|
// AgePublicKey age1... public key for SOPS recipients
|
|
AgePublicKey string `json:"age_public_key"`
|
|
|
|
// InfisicalClientId Infisical UniversalAuth client ID
|
|
InfisicalClientId string `json:"infisical_client_id"`
|
|
|
|
// InfisicalClientSecret Infisical UniversalAuth client secret
|
|
InfisicalClientSecret string `json:"infisical_client_secret"`
|
|
|
|
// MachineIdentityToken Infisical machine identity access token
|
|
MachineIdentityToken *string `json:"machine_identity_token,omitempty"`
|
|
}
|
|
|
|
// Entity defines model for Entity.
|
|
type Entity struct {
|
|
Attributes *map[string]interface{} `json:"attributes,omitempty"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
|
|
// Health last observed health, when the entity is monitored
|
|
Health *EntityHealth `json:"health"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
|
|
// LastCheckAt when health was last observed
|
|
LastCheckAt *time.Time `json:"last_check_at"`
|
|
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"`
|
|
}
|
|
|
|
// EntityHealth last observed health, when the entity is monitored
|
|
type EntityHealth string
|
|
|
|
// 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"`
|
|
|
|
// Health entity id -> health, present when include=status was requested
|
|
Health *map[string]GraphViewHealth `json:"health,omitempty"`
|
|
Nodes []Entity `json:"nodes"`
|
|
|
|
// Truncated True if node cap was hit
|
|
Truncated *bool `json:"truncated,omitempty"`
|
|
}
|
|
|
|
// GraphViewHealth defines model for GraphView.Health.
|
|
type GraphViewHealth string
|
|
|
|
// 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"`
|
|
|
|
// Stale last observation older than the check's expected cadence
|
|
Stale *int `json:"stale,omitempty"`
|
|
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"`
|
|
}
|
|
|
|
// ProvisionRequest defines model for ProvisionRequest.
|
|
type ProvisionRequest struct {
|
|
// Attributes VMID, cores, ram_mb, disk_gb, ip, template, mounts, services
|
|
Attributes *map[string]interface{} `json:"attributes,omitempty"`
|
|
|
|
// Host Slug of the Proxmox host (e.g. host:hubris)
|
|
Host string `json:"host"`
|
|
|
|
// Name Human-readable name
|
|
Name string `json:"name"`
|
|
|
|
// Slug e.g. lxc:jellyfin
|
|
Slug string `json:"slug"`
|
|
|
|
// Type Must be lxc, vm, or docker-container
|
|
Type string `json:"type"`
|
|
}
|
|
|
|
// ProvisionResponse defines model for ProvisionResponse.
|
|
type ProvisionResponse struct {
|
|
Entity Entity `json:"entity"`
|
|
|
|
// ExecutionId Execution ID to track provisioning progress
|
|
ExecutionId openapi_types.UUID `json:"execution_id"`
|
|
}
|
|
|
|
// ProvisionStatus defines model for ProvisionStatus.
|
|
type ProvisionStatus struct {
|
|
// Error Overall error if provisioning failed
|
|
Error *string `json:"error"`
|
|
Slug string `json:"slug"`
|
|
|
|
// State Current entity state
|
|
State string `json:"state"`
|
|
Steps []struct {
|
|
ErrorMessage *string `json:"error_message"`
|
|
FinishedAt *time.Time `json:"finished_at"`
|
|
StartedAt *time.Time `json:"started_at"`
|
|
Status ProvisionStatusStepsStatus `json:"status"`
|
|
Step string `json:"step"`
|
|
} `json:"steps"`
|
|
}
|
|
|
|
// ProvisionStatusStepsStatus defines model for ProvisionStatus.Steps.Status.
|
|
type ProvisionStatusStepsStatus string
|
|
|
|
// 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
|
|
|
|
// EntitySlug defines model for EntitySlug.
|
|
type EntitySlug = 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"`
|
|
|
|
// Token HMAC approval token (single-use, verified server-side)
|
|
Token *string `json:"token,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
|
|
|
|
// GetClientContextParams defines parameters for GetClientContext.
|
|
type GetClientContextParams struct {
|
|
// Since Return only changes since this timestamp (RFC 3339)
|
|
Since *time.Time `form:"since,omitempty" json:"since,omitempty"`
|
|
}
|
|
|
|
// 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"`
|
|
}
|
|
|
|
// ProvisionEntityParams defines parameters for ProvisionEntity.
|
|
type ProvisionEntityParams 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"`
|
|
|
|
// Include include=status joins entity_status and populates GraphView.health
|
|
Include *[]GetGraphParamsInclude `form:"include,omitempty" json:"include,omitempty"`
|
|
}
|
|
|
|
// GetGraphParamsInclude defines parameters for GetGraph.
|
|
type GetGraphParamsInclude string
|
|
|
|
// 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
|
|
|
|
// EnrollClientJSONRequestBody defines body for EnrollClient for application/json ContentType.
|
|
type EnrollClientJSONRequestBody = EnrollRequest
|
|
|
|
// CreateEntityJSONRequestBody defines body for CreateEntity for application/json ContentType.
|
|
type CreateEntityJSONRequestBody = EntityCreate
|
|
|
|
// ProvisionEntityJSONRequestBody defines body for ProvisionEntity for application/json ContentType.
|
|
type ProvisionEntityJSONRequestBody = ProvisionRequest
|
|
|
|
// 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)
|
|
// Enroll a new client — issue age key, create Infisical identity
|
|
// (POST /clients/enroll)
|
|
EnrollClient(w http.ResponseWriter, r *http.Request)
|
|
// Get agent context delta since a timestamp
|
|
// (GET /clients/{slug}/context)
|
|
GetClientContext(w http.ResponseWriter, r *http.Request, slug EntitySlug, params GetClientContextParams)
|
|
// List secrets accessible to this client
|
|
// (GET /clients/{slug}/secrets)
|
|
GetClientSecrets(w http.ResponseWriter, r *http.Request, slug EntitySlug)
|
|
// One-round-trip overview for the control room home page
|
|
// (GET /dashboard/summary)
|
|
GetDashboardSummary(w http.ResponseWriter, r *http.Request)
|
|
// 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)
|
|
// Provision a compute entity (LXC, VM, container) on a host
|
|
// (POST /entities/provision)
|
|
ProvisionEntity(w http.ResponseWriter, r *http.Request, params ProvisionEntityParams)
|
|
// 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)
|
|
// Poll provisioning progress for a compute entity
|
|
// (GET /entities/{slug}/provision/status)
|
|
GetProvisionStatus(w http.ResponseWriter, r *http.Request, slug EntitySlug)
|
|
// 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)
|
|
}
|
|
|
|
// Enroll a new client — issue age key, create Infisical identity
|
|
// (POST /clients/enroll)
|
|
func (_ Unimplemented) EnrollClient(w http.ResponseWriter, r *http.Request) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// Get agent context delta since a timestamp
|
|
// (GET /clients/{slug}/context)
|
|
func (_ Unimplemented) GetClientContext(w http.ResponseWriter, r *http.Request, slug EntitySlug, params GetClientContextParams) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// List secrets accessible to this client
|
|
// (GET /clients/{slug}/secrets)
|
|
func (_ Unimplemented) GetClientSecrets(w http.ResponseWriter, r *http.Request, slug EntitySlug) {
|
|
w.WriteHeader(http.StatusNotImplemented)
|
|
}
|
|
|
|
// One-round-trip overview for the control room home page
|
|
// (GET /dashboard/summary)
|
|
func (_ Unimplemented) GetDashboardSummary(w http.ResponseWriter, r *http.Request) {
|
|
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)
|
|
}
|
|
|
|
// Provision a compute entity (LXC, VM, container) on a host
|
|
// (POST /entities/provision)
|
|
func (_ Unimplemented) ProvisionEntity(w http.ResponseWriter, r *http.Request, params ProvisionEntityParams) {
|
|
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)
|
|
}
|
|
|
|
// Poll provisioning progress for a compute entity
|
|
// (GET /entities/{slug}/provision/status)
|
|
func (_ Unimplemented) GetProvisionStatus(w http.ResponseWriter, r *http.Request, slug EntitySlug) {
|
|
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)
|
|
}
|
|
|
|
// EnrollClient operation middleware
|
|
func (siw *ServerInterfaceWrapper) EnrollClient(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.EnrollClient(w, r)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetClientContext operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetClientContext(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "slug" -------------
|
|
var slug EntitySlug
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "slug", chi.URLParam(r, "slug"), &slug, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "slug", 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 GetClientContextParams
|
|
|
|
// ------------- Optional query parameter "since" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "since", r.URL.Query(), ¶ms.Since)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "since", Err: err})
|
|
return
|
|
}
|
|
|
|
handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
siw.Handler.GetClientContext(w, r, slug, params)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetClientSecrets operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetClientSecrets(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "slug" -------------
|
|
var slug EntitySlug
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "slug", chi.URLParam(r, "slug"), &slug, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "slug", 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.GetClientSecrets(w, r, slug)
|
|
}))
|
|
|
|
for _, middleware := range siw.HandlerMiddlewares {
|
|
handler = middleware(handler)
|
|
}
|
|
|
|
handler.ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetDashboardSummary operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetDashboardSummary(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.GetDashboardSummary(w, r)
|
|
}))
|
|
|
|
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)
|
|
}
|
|
|
|
// ProvisionEntity operation middleware
|
|
func (siw *ServerInterfaceWrapper) ProvisionEntity(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 ProvisionEntityParams
|
|
|
|
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.ProvisionEntity(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)
|
|
}
|
|
|
|
// GetProvisionStatus operation middleware
|
|
func (siw *ServerInterfaceWrapper) GetProvisionStatus(w http.ResponseWriter, r *http.Request) {
|
|
|
|
var err error
|
|
|
|
// ------------- Path parameter "slug" -------------
|
|
var slug EntitySlug
|
|
|
|
err = runtime.BindStyledParameterWithOptions("simple", "slug", chi.URLParam(r, "slug"), &slug, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "slug", 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.GetProvisionStatus(w, r, slug)
|
|
}))
|
|
|
|
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
|
|
}
|
|
|
|
// ------------- Optional query parameter "include" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "include", r.URL.Query(), ¶ms.Include)
|
|
if err != nil {
|
|
siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "include", 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.Post(options.BaseURL+"/clients/enroll", wrapper.EnrollClient)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/clients/{slug}/context", wrapper.GetClientContext)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/clients/{slug}/secrets", wrapper.GetClientSecrets)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Get(options.BaseURL+"/dashboard/summary", wrapper.GetDashboardSummary)
|
|
})
|
|
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.Post(options.BaseURL+"/entities/provision", wrapper.ProvisionEntity)
|
|
})
|
|
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+"/entities/{slug}/provision/status", wrapper.GetProvisionStatus)
|
|
})
|
|
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 EnrollClientRequestObject struct {
|
|
Body *EnrollClientJSONRequestBody
|
|
}
|
|
|
|
type EnrollClientResponseObject interface {
|
|
VisitEnrollClientResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type EnrollClient200JSONResponse EnrollResponse
|
|
|
|
func (response EnrollClient200JSONResponse) VisitEnrollClientResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type EnrollClientdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response EnrollClientdefaultApplicationProblemPlusJSONResponse) VisitEnrollClientResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type GetClientContextRequestObject struct {
|
|
Slug EntitySlug `json:"slug"`
|
|
Params GetClientContextParams
|
|
}
|
|
|
|
type GetClientContextResponseObject interface {
|
|
VisitGetClientContextResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type GetClientContext200JSONResponse ClientContext
|
|
|
|
func (response GetClientContext200JSONResponse) VisitGetClientContextResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type GetClientContextdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response GetClientContextdefaultApplicationProblemPlusJSONResponse) VisitGetClientContextResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type GetClientSecretsRequestObject struct {
|
|
Slug EntitySlug `json:"slug"`
|
|
}
|
|
|
|
type GetClientSecretsResponseObject interface {
|
|
VisitGetClientSecretsResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type GetClientSecrets200JSONResponse ClientSecrets
|
|
|
|
func (response GetClientSecrets200JSONResponse) VisitGetClientSecretsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type GetClientSecretsdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response GetClientSecretsdefaultApplicationProblemPlusJSONResponse) VisitGetClientSecretsResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/problem+json")
|
|
w.WriteHeader(response.StatusCode)
|
|
|
|
return json.NewEncoder(w).Encode(response.Body)
|
|
}
|
|
|
|
type GetDashboardSummaryRequestObject struct {
|
|
}
|
|
|
|
type GetDashboardSummaryResponseObject interface {
|
|
VisitGetDashboardSummaryResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type GetDashboardSummary200JSONResponse DashboardSummary
|
|
|
|
func (response GetDashboardSummary200JSONResponse) VisitGetDashboardSummaryResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type GetDashboardSummarydefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response GetDashboardSummarydefaultApplicationProblemPlusJSONResponse) VisitGetDashboardSummaryResponse(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 ProvisionEntityRequestObject struct {
|
|
Params ProvisionEntityParams
|
|
Body *ProvisionEntityJSONRequestBody
|
|
}
|
|
|
|
type ProvisionEntityResponseObject interface {
|
|
VisitProvisionEntityResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type ProvisionEntity201ResponseHeaders struct {
|
|
ETag string
|
|
}
|
|
|
|
type ProvisionEntity201JSONResponse struct {
|
|
Body ProvisionResponse
|
|
Headers ProvisionEntity201ResponseHeaders
|
|
}
|
|
|
|
func (response ProvisionEntity201JSONResponse) VisitProvisionEntityResponse(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 ProvisionEntitydefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response ProvisionEntitydefaultApplicationProblemPlusJSONResponse) VisitProvisionEntityResponse(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 GetProvisionStatusRequestObject struct {
|
|
Slug EntitySlug `json:"slug"`
|
|
}
|
|
|
|
type GetProvisionStatusResponseObject interface {
|
|
VisitGetProvisionStatusResponse(w http.ResponseWriter) error
|
|
}
|
|
|
|
type GetProvisionStatus200JSONResponse ProvisionStatus
|
|
|
|
func (response GetProvisionStatus200JSONResponse) VisitGetProvisionStatusResponse(w http.ResponseWriter) error {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(200)
|
|
|
|
return json.NewEncoder(w).Encode(response)
|
|
}
|
|
|
|
type GetProvisionStatusdefaultApplicationProblemPlusJSONResponse struct {
|
|
Body Problem
|
|
StatusCode int
|
|
}
|
|
|
|
func (response GetProvisionStatusdefaultApplicationProblemPlusJSONResponse) VisitGetProvisionStatusResponse(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)
|
|
// Enroll a new client — issue age key, create Infisical identity
|
|
// (POST /clients/enroll)
|
|
EnrollClient(ctx context.Context, request EnrollClientRequestObject) (EnrollClientResponseObject, error)
|
|
// Get agent context delta since a timestamp
|
|
// (GET /clients/{slug}/context)
|
|
GetClientContext(ctx context.Context, request GetClientContextRequestObject) (GetClientContextResponseObject, error)
|
|
// List secrets accessible to this client
|
|
// (GET /clients/{slug}/secrets)
|
|
GetClientSecrets(ctx context.Context, request GetClientSecretsRequestObject) (GetClientSecretsResponseObject, error)
|
|
// One-round-trip overview for the control room home page
|
|
// (GET /dashboard/summary)
|
|
GetDashboardSummary(ctx context.Context, request GetDashboardSummaryRequestObject) (GetDashboardSummaryResponseObject, 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)
|
|
// Provision a compute entity (LXC, VM, container) on a host
|
|
// (POST /entities/provision)
|
|
ProvisionEntity(ctx context.Context, request ProvisionEntityRequestObject) (ProvisionEntityResponseObject, 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)
|
|
// Poll provisioning progress for a compute entity
|
|
// (GET /entities/{slug}/provision/status)
|
|
GetProvisionStatus(ctx context.Context, request GetProvisionStatusRequestObject) (GetProvisionStatusResponseObject, 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))
|
|
}
|
|
}
|
|
|
|
// EnrollClient operation middleware
|
|
func (sh *strictHandler) EnrollClient(w http.ResponseWriter, r *http.Request) {
|
|
var request EnrollClientRequestObject
|
|
|
|
var body EnrollClientJSONRequestBody
|
|
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.EnrollClient(ctx, request.(EnrollClientRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "EnrollClient")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(EnrollClientResponseObject); ok {
|
|
if err := validResponse.VisitEnrollClientResponse(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))
|
|
}
|
|
}
|
|
|
|
// GetClientContext operation middleware
|
|
func (sh *strictHandler) GetClientContext(w http.ResponseWriter, r *http.Request, slug EntitySlug, params GetClientContextParams) {
|
|
var request GetClientContextRequestObject
|
|
|
|
request.Slug = slug
|
|
request.Params = params
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.GetClientContext(ctx, request.(GetClientContextRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "GetClientContext")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(GetClientContextResponseObject); ok {
|
|
if err := validResponse.VisitGetClientContextResponse(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))
|
|
}
|
|
}
|
|
|
|
// GetClientSecrets operation middleware
|
|
func (sh *strictHandler) GetClientSecrets(w http.ResponseWriter, r *http.Request, slug EntitySlug) {
|
|
var request GetClientSecretsRequestObject
|
|
|
|
request.Slug = slug
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.GetClientSecrets(ctx, request.(GetClientSecretsRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "GetClientSecrets")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(GetClientSecretsResponseObject); ok {
|
|
if err := validResponse.VisitGetClientSecretsResponse(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))
|
|
}
|
|
}
|
|
|
|
// GetDashboardSummary operation middleware
|
|
func (sh *strictHandler) GetDashboardSummary(w http.ResponseWriter, r *http.Request) {
|
|
var request GetDashboardSummaryRequestObject
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.GetDashboardSummary(ctx, request.(GetDashboardSummaryRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "GetDashboardSummary")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(GetDashboardSummaryResponseObject); ok {
|
|
if err := validResponse.VisitGetDashboardSummaryResponse(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))
|
|
}
|
|
}
|
|
|
|
// ProvisionEntity operation middleware
|
|
func (sh *strictHandler) ProvisionEntity(w http.ResponseWriter, r *http.Request, params ProvisionEntityParams) {
|
|
var request ProvisionEntityRequestObject
|
|
|
|
request.Params = params
|
|
|
|
var body ProvisionEntityJSONRequestBody
|
|
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.ProvisionEntity(ctx, request.(ProvisionEntityRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "ProvisionEntity")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(ProvisionEntityResponseObject); ok {
|
|
if err := validResponse.VisitProvisionEntityResponse(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))
|
|
}
|
|
}
|
|
|
|
// GetProvisionStatus operation middleware
|
|
func (sh *strictHandler) GetProvisionStatus(w http.ResponseWriter, r *http.Request, slug EntitySlug) {
|
|
var request GetProvisionStatusRequestObject
|
|
|
|
request.Slug = slug
|
|
|
|
handler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, request interface{}) (interface{}, error) {
|
|
return sh.ssi.GetProvisionStatus(ctx, request.(GetProvisionStatusRequestObject))
|
|
}
|
|
for _, middleware := range sh.middlewares {
|
|
handler = middleware(handler, "GetProvisionStatus")
|
|
}
|
|
|
|
response, err := handler(r.Context(), w, r, request)
|
|
|
|
if err != nil {
|
|
sh.options.ResponseErrorHandlerFunc(w, r, err)
|
|
} else if validResponse, ok := response.(GetProvisionStatusResponseObject); ok {
|
|
if err := validResponse.VisitGetProvisionStatusResponse(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/+x963IbudXgq6C4WzXUpClq7JlkI9f3Q5E1thM71lqafJuKXBTYfUhihAZ6ADQlxuWq",
|
|
"/NoH2MoT5km2cO1uEk02L7KcqfyxJTUaDZwLcO7nUy/lecEZMCV7p596M8AZCPPjxTWe6v8zkKkghSKc",
|
|
"9U57H0DyUqSA5iAk4QxNuEBvJoN3WKWzXtKT6QxyrN9TiwJ6pz2pBGHT3ufPn5NegQXOQbkPnJdCcrH6",
|
|
"ifcF/qUElJrHaCJ4jjAqBMwJLyUSIAvOJHwjEYMHNbLDekmP6Hd/KUEsekmP4Vx/PDxsX1bSu2CKqMWb",
|
|
"bHUlP/305iXiAklaTlEfjqfH6HbGpTqdlWNB5O2R/2yB1az6Ksl6SU/ALyURkPVOlSihywquaBkBuH3W",
|
|
"WMK9PM1xOsgJI7cJuqUP6WmKs2zRth797pYr+lHw/Jrotz9FAaux0gDrhIscq95pL8MKBkq/mkTmfZNB",
|
|
"XnAFLF38CRaruz2nBJgaTIGBwAoydAeLF0hAQfFConuiZoShZ9/PkABVCobUDBAXZEoYpoE0PBQsMVeL",
|
|
"rn18oL9eX3+OH94Cm6pZ7/S7Z/8ruvSJpfFVDF3jaUWmhAv06uL6Bfr+u2eIs8AnOZG545H44ioe2gZR",
|
|
"b0lOVBuWqHlYnyCDCS6p6p3+cJLoPZO8zHunz070b4TZ374LuydMwRSE+dA1X0cPim9PDZ/1Ti3GzHlw",
|
|
"CSwjbHpWFILPMdV/SjlTwMz+cFFQkmIN8+HPUgP+U+2D/1PApHfa+x/D6jgb2qdyGCY0n1yitxlmU0BS",
|
|
"4SlkLxBGOSg8wO4NdI8lSgUYSuxnJaYDvSLB6VHvc9K7FHxMIV+z0MKO+M12C/bzRtZ7IQQXqP/hx3P0",
|
|
"++9/+J1ZxhWZMkx/KjSss4NBzc4aW4P7EpJ+hMe8weLZFJg6SxWZE2UYvBC8AKGIRTJ2T0aWGj71gGma",
|
|
"+1tPcU5HKabUMACWnGkq0d9OiWagXtLL02Lk6Q5kiqnZV+/jCmklPaxXMSJZhGmSXsqFAPuyG8JKSvGY",
|
|
"gue4lVeyUtjxuVwzPvBL0gNzbHedvrHQ2iyEFaUayTLPsVh0momXattXJEi5BShkmaYg14FhzDkFzPRg",
|
|
"xe+AjVJeWnLcDDdDBvZQ6bAWK7R0vHuqY/Vv9opWslejlGSJNiuy4uOfIVX6e/WzaZWuLXutkps9QEZY",
|
|
"dV2spfps/TubadbNMe5GBvBQEAFyq2Vakgljy9LCdXnYHWFZndfhAdJSWaYuOCXpYpCag1j/jpUCwQYG",
|
|
"Ge0MXuAF5TgisxkRSeOGS8iQnR1lZDJpB1mFX0Hk3Sil2JL3Kuk7CW31gcKqlPUtFvYy01RlaAYyc5Yx",
|
|
"Yn6wsLZi4pzfQRbdoyztwtbKhFoCCvdVylkKgsnN5BHjBycnOlJuQMPhMOy0QS4NEl/HNh9KCluxDi4V",
|
|
"ZzxfjCjMgdbhq59U14DhB5iDiMLRncX+xmnC8h1eoDEgPJZK4FShPmEzEERJlPF7dtSF0TpywSbiSnkB",
|
|
"I7vW9SjXKlcBYmDHIj4HIUgGsstanTgau25iJBGnhSW0VLNuQv65oZOnJ4F9cbOemToBLQqqMiPqgimx",
|
|
"2A5EqeKi6/VtBy9LX+YW7CU9/UWsrMq8kAq8kpeVtAWyuwhToDChta1UEDiM2JSDmvFuUxhNuZPYY8we",
|
|
"I1J0G22OyVHKM+go9xxAkqkwGxg3TmWWEK9AKT3jCqndWc0cHnBe6DX3ppSPMT3WFDzCqYodbqVVCraS",
|
|
"HuaYlnF27H5K3Rk93s60/hw6n0F6t7rZlLMJidhd/oIpsXqOPmrd7RehV43WOhnWhN+O94LemphjOpJx",
|
|
"al6WnmZKFXqeVP+bEXmnL2AQamCuZA2OTJCJxlJhJRApZwO7tSgHUyzVaAaYqohx43pGJEo16L6RiN8z",
|
|
"lHOpkIAUmEJzEBlJ1TE6Y8hy7jcS2ZkQkUY0uedCKsQn+hcJCKeCS4n09epAZyeXCZIcKf0xItH9DCsE",
|
|
"DwXFhEn07f1s8S3C/hN6QAZTgTPIjtGfS0pRyRSh5nNmMjQh+qOiZPJYXxAebmZhBj7udf0jv9cndcnu",
|
|
"mP7pY4cr1MBLlMzRehNe/z0DZvdhl6IHIyvvhuX+FzIXlV6gXt9u0n2rLKqwmMIGobFPmFSYpTAwN1vW",
|
|
"ScyxE7eIUW52/RD19b9bzUxy4FprjTPAmtMg6f2dsy664hp51/F2jQ3rK6p4vMPx0ibfVIfMuhMkGOfa",
|
|
"tOnmSRGG//bkJHmCc6MDBW6iofWUEDb4XXR/HvPrMV1HciveLr1ldxe0bcJT5LJfR++fY4vUMiSZOEve",
|
|
"bvJz6u+/lSFje6LhjFgdlijI43Kw+wMWAi/iwt9BrB8dL05nKhgZNGXA0nUHASvzsYV+ZV2MIVZAyvMc",
|
|
"mLG+BLDuazkQvFSwrLwMrCxVU2BmnLaYAoyttbOJ7o7QzoMrbt3hCI2rOna3TTvuEqlstBlYT9A5Zwoe",
|
|
"VITijdluQijIkbUdRWxBl1jNpBY+zGikLz1RmhUj8yZSWtDwrydbEL4kjtqWpCWSg1Q4L4yOrgUSBg8K",
|
|
"FZxSpGEHUrVd+BGFo5CWtKftO7wWJSAyQcd69PEC5/o7KSk07GRtZzHLLKddQGfGDb89lqDK4ljOdodZ",
|
|
"7RpfMsFwxhVnJEWpRXdwmjmmTTZpAWsvZkNIV5AKsErWirIjV5f0hk2IJCmmSJoXkR6GsLF8kzEFpJy0",
|
|
"mprZt4DDqv4io8t+ieVszLHIripT/hILOMOKHHljY/SyMVIzATkaL0ZaLTVki7OM6K1ietmYc/X1Jeuq",
|
|
"FfOMQV9qoECGxgtk501a9Hn3cX/pH/jbTuFd/fRcnxDCbXhpKv3MzzQu0ztQdrIfBjlhpQLkr/CkofDo",
|
|
"i7KO6yZC7ETdr7ngFtlA3W5e/0KMWpZ5LVjYD4R2P10c84lVc559P4sholItm+AKWlh8AVodiz7xelz0",
|
|
"oVSYRhBu1sfHUuPU7IPTDPQJjVmlN34jtdIJqaaFFFuBIiZ4emVxM+Y6qpwrILPXvcWdVhWd2XFX9PEC",
|
|
"GOozzgYCJKdzyI6c93YVn/5zK6ta2toKZ8dOmoD8+JaSyBkWp90GO8cgdsEEp/SDu2NXaG3GpfJexSZs",
|
|
"zlJVYor8AGeqQGDmI2yKcpzOCIsycA5y5iyCzUmvbIyUfo7eXBphQAuo5vyaW8OSFZtalapNQUD38pTB",
|
|
"/YDiQvHiaKOV0Ey7Dm4uciYmZ40KQeZYweguFrFz9upicHVx/uHievCni78Ojo+PzXYp15dnBqlYFG17",
|
|
"NXOXY0rS+NR4Ct/p+ewYTaNm6qv3l1c1KSduUnPX98jez04Wbrvjf2JESxCYnpVq5q509OZlp5mtfLD1",
|
|
"7O61GFFZeht5ghkZH/q6D7g3KhKzcgqyL24ijSUsJCsoj4OzHRRxMlPxcBClBBmXqnGOVa/tojy2WTJr",
|
|
"VwBkzkqZoHtrr4OacTHnjChu3bPb2A795fPxcC5Do5ibuylqbDSLd/bWeyxRY4s7WxZzrC8ShlkKI2NZ",
|
|
"3T0EwR+5rcdc5WOoxVX2WhwqHWNC2mxLO7kotnOXOmOTuw/N7qs5GuTcWE47x7Q6TBt80+a5wFOsdV5D",
|
|
"3/oD30gUXhy5MLDIpzdirR07zZW8tAY8abUlQJRMIF2kVC/EGfdGS6rDKh6XdMVSKuOvR1qcCV57qMzP",
|
|
"3e7CJpLaEXAZj/k8U4iC4TYWRIYJAZpJlLsVFgIkMHXcS7bA3TsQJhBxvoLDLoj7IpwbR/W1sSJVGLaK",
|
|
"AeorgZk0Qmu1p7i40oKAa0cGLTAc1WNb6wv649X7P6MrD6qN9rvGy5FtZ1wDN/qIyJGnw7g5mOIFiLrx",
|
|
"LweF7QUqsDVJlUJjZcrnIAz6jLI3ZaQ1/ikAuquZrxWhBRb68vbsttm4aGA6WuuUWY2HMuFcYO7PQkBq",
|
|
"QlU/7nXgutPVIcZDuYmOsJKPa+lr4yk7WgnBfgzKCf6OCaYy6gBaoaRDktDOJLP+uI3jaT1CWvwxB8HH",
|
|
"rrQZPaLmLs562W+0fUwMVvgRI2LqVoQa7fBe0rvHwpvoBVFano97IIxKGzdwyu4CVQg8CoKfNQwcC0wk",
|
|
"ZFuEu7j7u2ZMcEuMklaION3Kd1aLIt8cWOVMGV3Hpw2fXue3uAab2jM0+JH8dltHyXd29AmcR6SlqztC",
|
|
"KbJPUX9VZrJP3GFxFJOYBEhz4u7v4XtED50dXLsZNwN2naQu9qWeSLSzi7duhjvbeLG14c/O1meOH83H",
|
|
"k0XtZzt4gomNvtDLy0a8NJZwfcNR+3fB9Q+jMU7v3G/6x5F77+M+Ls/aQiKS3dYx1CF4eltnaDi+Wg2c",
|
|
"1SlWnawCDLbXc1SEJbBsuzrrNL7EitacbJyDOTeh+5BZF1mfF9ZofdRLtg5Xqqdgbrwc3Fxrox9fCVzM",
|
|
"/kLgfhWGkE2hGQCxLkHqg0OgnJEi5oKp7FBtZvsdjUuReNqIm4xkaHBTnpw8h2DrchqptXkRltIyg/+y",
|
|
"NGnMR85DDdFIR8azLYDj7H0RsChRstRnqsWd2fpTKMWFWdSMqIj/elnG5Db83WIwhvbXBgatvlTvumhs",
|
|
"cMmFEPB5KLytWPcOHQkooBkBRnJ9Fvu8Or1kF+ilzAe2C4PsJv03jS0Ohl08mLINVf9xG7a4DZch7wBY",
|
|
"+eWicP8T4/dU881rErlWutqpCbuDbBTloo1xIQKzu06BW+1CDSNFEbtEXpPpjJLpTKPGZF/7CJNOfGUj",
|
|
"/jtnCCiiKKzZccWHGU/L3IaNiJKNOb8z1qA5SEWmbTlvm+3NdgExJL/1qv5LfWSvclTdFBs1VGTttsAt",
|
|
"sa1A5ERLETu9HKyJEW3g00Tw/BR9UvwUfXKgkqfobwznkA0Mqybo+Pj44+fPnze6t4lPdjP3yoqxuraO",
|
|
"GLzfgRIkvQLhIBy5bBZtildu3m2JIqS0LOqUJPB9L+l9N9P/tEQOGmlw3cWG59NO7LdFFm+OHzpNmRPW",
|
|
"adw2FoaQVbJUuATfIwsL5LNFNnx2WbiUne6tcOmuE4+uzaBoSMXCKgSOCgLOK0TGFnFpI2G3M24UBSUg",
|
|
"22Oxm2G1S2kOhErOEOX3INCYlyxLtMRW2CASmNv3bOL38IdeBKXNMfFbWatwpVg7ZBtHajAQ7CVuFRWs",
|
|
"V579UmKBmSKsLTJ8iwzi2aLgagaS/N3mHvjF+0T1JYOluUDCmI/tifvroLmbu7NBSTXd10OqQUormK+p",
|
|
"xevCOGvFNpZvr6VswlrWpxBcRG6KHwnQbGDyMGvhOMgOR/3vnz07ao/yM26++PHcpjkvwc7OEMZ3OVV8",
|
|
"vs4G2omlGmwSSoLXoYfHvFSnY6rlsVrwQCnIZs3bfGatu+VSqx5yrQ1jnVP73ZuXCUq5AJkggfNRPk5Q",
|
|
"RuTdaDpOECkSpCAvqAlGzE1MW4K02E5SkNGgRC4j8uIVLafenXsp+EPOH0xkmAu6qsUoRG0Z8Qiz12WO",
|
|
"2UAAzvS5gpw/pGPkl/kufUhPfwZKFxPCtneV04c0QfM8QVygjKd3IEwVG0xYPbS6u7PcAW8DjtsCyqok",
|
|
"6m72gxANGDU7BcMYevPSRBkInN6hwi+DsKn+ZSrA2N82XBPR67i3tIS1274KnLi0aX2yRCqdzUFgSu3B",
|
|
"g8ikufBg+NzdAtDirD8vhQAWoiZaQzCkgmKd5GjWPcpBSjzt5jyeEEbkbH/782PYsEMAqiiZ84gZxSzg",
|
|
"Qd5pNbPlclVQdLCG6FFrT8m1yQKOGT2+LHpiszRskxvO2Y2Oj8rzFz8sXUHAwC6dTbzhtLWxI2smaBNR",
|
|
"zeU9MsXottEPSDZSfFfaWcaJhU5SGZ/dWVlb2yYUdYvy6oyY9TbzdnxsfK+bxS8OkE0wiMf5pFhkhGG6",
|
|
"5LrmDAaKD7gJy3a/5Jhp4tH/Vc/8b+bhRtt5zPLBtFAK+4XYOEtSpwI0vW0zrze+H4/HqK+p+YWkAfUo",
|
|
"3oi8O/ee0HhS0qj6ZIU25hBWFRnxP9pEN5G3nK4hiRVTrXK2KFebcNmCnzh8VjcSWUYMOK5w3iopG0N/",
|
|
"R5ev15E6XqpCqpEEYFt56ycUF+uUwRmn2Sjj92zfWMJtq4RVoSFWgB8403dcq99635TcAV2MUlx25Ou8",
|
|
"VHvHU/I0NULXeoPHAcJ0NoqClenQBdzg9M77ALxxwXxHb9uqqTZnqBKFPu5yyVcx9jZx8hClynxRsloM",
|
|
"kJONVuC9zCZL1BPl5DtC6V42tc2BOCaPdlRZDjq+0bmq3zb2sVLuKVSvCRi0mfok29LgXwieQlaKmPjp",
|
|
"ox4zZAThoY0fGfoAkKGPCyooZujD88Hvj1ZCsb3fbhQil9pq8DB9Dnp7ZL7iC9+8kXooUjzuwq27s4/d",
|
|
"kOeV1ihi7tMV1W3nqSxcDzFXRBuSIfAnngjZ3V6aCTxxsQs+iCHYSQVMjE22psxtiEP2xlKxPu2ksmfv",
|
|
"ZjpdSREJxtNgFK1YoPWMunLK53IUap5jFjGavOLBWGaKB7o4uV68KKirQLnMOESF6mYxd3rGSz3AmJlk",
|
|
"XOjqnnciIF4ST+ltqNYUWIoX3UusaKW/GVst5ayX+Ko5Jh+ctVy6bXffFoCOF7757cnG0gdu3UlAd4xK",
|
|
"rr1TagmAjOeYLlqkaSKgCirbIYJkVeDkmuOidldiHHOUMMACFYL/bD+doN9lyEb8bfYltvtNJeUxzemt",
|
|
"/dyEKFSAQBlebO0UDG66ClrRwAwJaaklFJOQ4qoFABYgzspYruJ7pxYN5wTuQZwiPUxLT3fo/ZuX5+iP",
|
|
"/31dj3clbHB2+Qb96x//ROc4yxY3bMLFPRbZAJe2FFsGE2ASBoQNMijULEGM27wwZ73REpoo1ezo+IaZ",
|
|
"Et6nxixIUmTXaZNJbZn7KvO0b4p8oVsTKH2r3/Vl4A0xmTcrajesZAqKG5nWVSp3yQ+ukHymuOCrQW3n",
|
|
"tuz6QN/lgPRmfYGV9+SOSzTjOVA8Ru+vjpEpWTchFHwNum+/DZu8YWaX336L+qaSO07VwMiFR6foFTce",
|
|
"AxBIqnIsERaAqkYE90TNEMcFGehjbwosuWE271Wivv/8+ds3CZqUWipBP72RRxZeBsw4ByQLSI9v2A07",
|
|
"52yu0clZTT55fnR6wwbownqh9Nd9mXd021ZU/vZYv/KWSCVRKQHdfjJ3dFLvjfH51i7eNdQo8JQw6/Dq",
|
|
"u4MGmUYB6IeTBOX4AT07OTky8/7EJJ4Aunx/dW2LnxQK3S51UbhFfduPoaB4ge4Jy/i9fftdaQ4FJFzL",
|
|
"EIlSLMQC3brb7vYFenVx7To5SHR7cY2ntwm6PLs+f418/Aa69Y0RblHftVTwrRTsZ0LNnQpmz58//z36",
|
|
"6frcPL9wQUnmKc4yAVKadY2b0aWo3+ztYRB1PQP07vzSlgOZ4BRQXyoBODczvL6+vkwQn0xISjDVBHT1",
|
|
"8k9HNoe4ZCYSXaHbYZ4WtzeMs4oQxoRhsUCYZXowL02FRMtLlq41y7ogoRemWqIpw4PuBS5uWEVPVj9G",
|
|
"JqUGYemKLALLCk6YkpYfKUnBuWIck13a7G59XAvqGFOeDodO8z52nuShywKv+RF7lt3OLt/UpJbT3nfH",
|
|
"J8cnRs0tgOGC9E57z49Pjp9bJ/DMnHdDc0gMcK01gLs0rRGIcPYm6532/ncJYtHsItDsHPO3eAuKWiH3",
|
|
"NQ0zWt5tVH7fYYJ66Mbal2OSc7W5Yei70mGs68jRYaTrtNNhpG0n8vnjUmuOZycnWzWWWAoi9GpDJ/2h",
|
|
"ifqIPlJv+7N91TKzhMgdvXLl+CUgYMrEcX1OKsEsvoUAs1oLj1okq+2NgcYww3NiamQYMzueSmPTtmGm",
|
|
"Y+LNrg8Dv3BbS7N32rPigJl1GEqntHKSvhbOwqhOTBS0jgqXh6to38Y83oqz8sm9+wT86ngjtLJ5OrYI",
|
|
"BLU/P2gCRbhGoZ4XqhJA2zDC8BPJPg9DwxgN6ybFb0BwaASmcVy4AJEmS700PTUCGpItv7DU/srSkomG",
|
|
"+QPPFnuQUX3TIa3Vsqnl0kXgzKhqxnhL5G9L8ZnX787Oq7YTVjfoS8KmFAalhAT5vCknUg8kyWBzmaKw",
|
|
"jTglNhtjfd6TEXftGfXSLRIJSLnIIDvEzWBxZUJ0gC3qsHTQbQVoV5YJXjfLNGVm4/3XyGBmSDfZq156",
|
|
"fhfpy/YveEzBq03s42yXN1cS+P4j9O13sVWdL57watOL8OIe6iuJXl5cnR8dgr3NzNvLe02etZXy14p7",
|
|
"53ZIJ6ZdEbs60n6I69iBWX0l9ZVXa5l9vy7Ktm0nno6oHUUcSFizTQ0ymBDm0l8qgnYVHjdIbG2SlY2B",
|
|
"stB6QrFqIypdrFYneeS7w346il6bOH4A/NqZEHY47tvTZoDlIMMKJ8ibKX931BnnsePLCOn7yua+PEyT",
|
|
"hEzVmB0pyDV3fVTSsVVtvrAk20o5vmHo/pRjZzKyK7GmVUdEuxJKozLKhgtvaWw3K0eoY/ClJU5fGX/V",
|
|
"1rFVQ4Bf3SXZ7G/xhLflEjkd4Fh1M4LW7KziqGXLGSAXTchLOfBPkFHLkBKY0KNd7SHOKzW0JYwNaqLJ",
|
|
"Lr5OpPR1ipPg7pIIM4SngO5gUWAiEtcF2fy9vfBsYjwateTYRtQXb6Q3HKNzTCkIWy8RUwE4W6AZnkO9",
|
|
"1RMz1w6DTJ8ujewIE+hlHRzNU8FWND73dfkf4zRvFpv+wgf6UsXmWJNoMyIHpkJLdOsBtE0MWBYQdgD6",
|
|
"th9DGDG498WN//WPfyIiZQmehjz91GgnLKGicke4LSRuWxQ2KPyTpOX08zCtmoREwzA+OA/j/YykM9cL",
|
|
"xPT/SKxbzZKtKStt+2349hbItPkwRDwlc2BIeV+j8TIz5B3ApsGH7V7GpAKcIT5BU6JQUVIaI9JXoJoN",
|
|
"TlburdgWEGd04RYnw+KIrNZlW4M/f/7cBLvF7z6bhblls/aPjymiNCARO5VdW5AMqMIHoNlXoBwZpPWZ",
|
|
"HURxBc5tiTPZSaq9ouW09/ljhLJl1bVkurbI+MAEmBjroHnDOpMzX3jXTvuNXDmx2wnTN0x5dLz7D0Xw",
|
|
"ftWp98qBVFsPuXVNXr4sMWS+BcywVgwnKgm/ArXSL+YREbfyrZiV3I9BfvH74+k9g4HgJcsGSpDChNRp",
|
|
"wSfEAqU2SggJznMTEoQKPIU9fKz1gjatKogPMNl0hv9IqAJh6iPUmyW6QlwS6dHAMsyUbDu8d7Wwh4zB",
|
|
"bV8MVVu3ftOX41374hK7l2P70NXq4cwE5gxdkGzsK7/saXr/t9KS2ouqfSHtyNXko0Qe7NSFinmCslMr",
|
|
"V7WzIfHCX29fpSWxUdz/C5sSPRW12xJNrbQMbOWMi2s8bZvSDRuaMW7Cg9ggGVpRDjZQRdOC5AcPg8rY",
|
|
"rgafO8223gSkUjtdf6t50JVTzqTWz03cp61KoTXnFBc4NSqwj/g+SpA3ZLnZrbuxqk5rIloiOnNTUdbH",
|
|
"oN9dcLnHdIpQheDrpv2VOiBfmP5Xa1S0n3SuLGvSRMgvJZRPyiZhCwgj/VqpAun23/6f8wT95V2CQo2P",
|
|
"I2QGmqId+/KTN963SaGB9B7R/NF2fDmcuXpAT4edV6GWwXKI8U6X3AHcJMtpD75HR/3UwQIiXUdqnWOq",
|
|
"dgEZTF7cMEIpTDFtTGJjudH3J7/Xcq2ZblA9PzpGlzaKb6o/csPsgai10kX16nPU96dcgMtR9LzT29v1",
|
|
"rHtkf0+9ecwXtw+2MYjz+FR361NxiHMYVeUtNIPUOsUsdZE5yKk1NF2uB1WX67Yj7A963Ac7rJM3ySTU",
|
|
"NPSQAJ7nphQiycu8d/pDJJXrsbWJ5SDBwiYbtTSJ7VyVqa1Qkv3A1mVttojQmUxsnV2PWmvXngpczFBG",
|
|
"XI20Qxi1fc6I/yCZWFOQO9gnmFD5RY/zVYL2AWhy84UcCq10o2gBdOdgvioRLsoRvTE3zBIquZjkPmNi",
|
|
"ME8+Ht70vI/Kvb7I+850XJ/2EE7GlwboSNSnNX3Pgyetr6GLAnLk0RMSr7VtB5F6WOVyt1HxcoG1R7w+",
|
|
"lz8Vwd5l0w8JhTuG3D4OIN9zSuNF7Iypc1no/1KorJmmTTdeuT5++GLu2rN2OHEePe8qahWtlQ35TwDw",
|
|
"E9s2585n8lSmzbnN5D1g0O9rIhUXxtkNnhV2dkTMLbRM7mmrO/DKpgZcAVPIbugYXeB0Zr//jUS3JLv1",
|
|
"WdG2B77g94hkqC9AljncMHOQ3b7VorKZYfDm5e1Rgm7N6KV3NVATdJthhcOTP169//MNM68iC+1j9Bqw",
|
|
"UGPASp9buYGz5rwF+u4HeYz+AFINYDLhwrhhiXnyr3/884aZutKQoQLEQJZjvdMxCDQuJxMQCcoELwac",
|
|
"ZiCVS6K+/O3RC5MG/eriGjmY3TDF0RindxMSd8VfGZi2HVatLpwAAVQImJCHfT02VsmqXmygYO0Mm9lW",
|
|
"wYOy4BhUFNQ+4aof9uoCuRcPYfafewKyc6L+1dXF0T7MUUVHrfXTVcN2zYV89Aj5ryQj5d/r6ghZok94",
|
|
"fVS0dSjHWJ1at44DTFqcHdczQDPMMgpi2TvRDzF8hgaPEhvDK52fYuiLHyY3DLMMAVEzEAiYsYa7ayFU",
|
|
"Y+7bcFaXKHyEuKhFEN6wkDnobG/GB+ILQTRnIgzd+vZytyHq74xKjuDB/NUHudiIHsEpmAA0G45lp3v/",
|
|
"57d/Rfd4YcdIvcXYVeA8Ehf1tOOv0n243A7uS7sQK45bwwree4L6uS1R6jLIgxPrEELWh0BAdepzpL1A",
|
|
"//q//69KU7WJDfpPjmq3CrGtxR9WYzc7RGq09Hgm3074OIRdLIDYtY37DXIdNHc7o/ayJzSRMLQtIR8l",
|
|
"6/vcTP30qDwPXS8P4Go3cyGM/OE6DL04Ub3uwo75xfpsFu0Jxhfm8RVAtrcxZ0l0MIWVuI2Va0Lvr2fv",
|
|
"3qJa663VGq1Mccqnu7xq78itX1ySN8ICkto+wuRd5BANUTQu9QV/kMPVJwQgqSfWu5G2plXqWgi8/IPv",
|
|
"9P/yAxoiVxLIR+I1UsUWUkHeiXiMPX/dqWqaeG5S1q4UFsET26/7YY9eIJ4TZYxp9zMtMFgPQt+2MGqL",
|
|
"vhOc7yTUr3EQPdvgIEpMjVJqCi1aibWzvb57bVKpFqa204SLvLcalrfUKfRnTpj3g4zc37T4VvCipEbC",
|
|
"Cy1Wj12/x6TLJtxn4nsINRmXOyd03dVjxq9XLWUjHGkeorl5ujdDXpVjS6macudElpiSv7tabqYHKvoN",
|
|
"Mj1QdzDva8arepy2cd6PFEC99mh9NJA227VGwGoHHDC22GzMtcr101qzvunohgjL9Fa42MeMFwptDyVg",
|
|
"kbZD+so8Dr05uxksfuktKwH7WQG+At2+0Z30cP6310QdQlH/saR0YPJHLDptkdeA5MpL3fcigEyQ6/jZ",
|
|
"YNHwylY09Cl4PzrEZNVp6deGzrem/WwF+ENU7KA0yG1y6HGGbKNbpHg0RrUrGuPcbBrNRj1b3ZnaaEa2",
|
|
"KO0G79w7N6jTydLZzdbhng8lcw8iqsTlNN8yMxJ/gEvFa/EHzQaqtsXHbgnXuzjxnvJobfSoPRwv2mmR",
|
|
"hAPVTDTEajLyBnZOlAfK3fUarit6bafm+0oXOyCKHCNpKG6b92EaJEVYIgTLdZ+w0Q461pG7Fkey5VpX",
|
|
"WjptoqwGRKKfbmyxCwkG1B3mhkeeXIxZuZa7pS/z2nL932qrrZGoX1N36rQRM4tBQEDcpF8PqUVYuhTm",
|
|
"UV4qpxgEw7vmHDwI5tD7GTBURdiuWMPriTTXVrv8ipNp9AqfMqHGEvvaAj3PTp51oENrJK9X+tzbaKu0",
|
|
"AqNmUFGyUWxszn6NoLvTa9NeE6XY4Sd9HcdK/USkHZfit4Wg0xre/hqLDGVAQZkC8IwrJMui4MJUcZ+Z",
|
|
"uvCum65E8ECkrVcQ+oGEFH4bU/DyeYQ1aqHnu3HGFwk/10t7whD0No6oFR56Io6oFSwKWK9CJffhBFeV",
|
|
"eH0gwqUftI3svUdxzR0jCrrFP/yaIgl8G/2niyMIpHGgKIKiIjVPzxRcJ7nNkoh/+6A12+KdTpDEE1AL",
|
|
"NMd0Du7ovXr1u6NjdBYKfOvjvKhLOyuiztX3bYf1ZehF/+VP6iZJtpZa/qXEAjNlGlVFO/Ks9ryqGv7X",
|
|
"ml3VOlsZP1IYE1Nrn7bMcmC4r/GWuK4SkrBnJNR39eYBDVEFWzSsbpKj7ry2dHe4OJuQ/FZS6Fbc/0NJ",
|
|
"Qfa+grr0eiGHTJMw+zpwnXkkyqZqVrlXdwioOg/KVaNBQfjaCyN3608i1xzSFnHCEwViNa/bn3zPW/Wx",
|
|
"Bqi/Uo2svsZtdLInYfNLG//gtKEGlaB+VmI6iDiz19JMB7Z+7Cqo+1HJI2sn/6bkYSjCsfchCcPFVa4z",
|
|
"Rp65MVegFGHTpz3rm2s54HEfdneIgut2kUi6OVH/jlA6kPdEpbMEMZiDGPiaq6aizdEOV0Jcpv2AiTRx",
|
|
"jn4RRKI6vVDIUP/ZyTP0myoU8hi95fdgih8RZdMf3NLR7ZTyMabHeroRTtUpuunxyeSmd6s1WJzZmEq7",
|
|
"pZEfhO7AZVH4a4fkOWQEK6AL/fWTo1NzNdXAYktxmnnQPXbxMZitLzpiTpsYee52bujt6EeYXjZotM0z",
|
|
"9Hhy69fJI2cGmzZhRwliQ7WfUEgOx6OndV+dsnFCvmiQ2fsff9QsEQhyv/NTEHk3MAG/G6TlD0Tenbtx",
|
|
"T5lS7JdxSEGZyDvkYXAgeVnU59zyaNToaSQj20OSglV9lwv2Zo00627JOaal5LYBL2uTdfaeqRaGt5Uh",
|
|
"e4kUv49VsK25mYAdpufQBcu0VFOfui9BSVsGZqS41V1MJAuR6A4KeyPMTF7j4miXshxtatSFa1lpfWiR",
|
|
"QjSrfkHUnxEQWKSzxQDfYwFHL1CKRUYYprZt34SLFLI2RWo9zX0dilR9jU/j3GoWQPgi/ScaFOkilnaq",
|
|
"/+J7Dqy7FK7cmM4ZgXCwTPPQU5tNeC/p3TtTUdJLBVEkjfYaf5Q8+C6NgH5NZn6L8ye08nuiO1Tl4kDD",
|
|
"27XiqfGITaHB6d2j5M+cpXcO5nGsr9+5ffVw7UrO0ipCEzvg7dippAG9vLTSzcHB965UUIPfIZwQeq2j",
|
|
"kilCu1aAb+0RudwRv5p5jyaOX5YiNIADKbgSK9fXbw9BFAIkp/PHoYsPdu4Dk0Y7mleQ+VUgz0Ghwl+O",
|
|
"WYkpXeyKPq2qbhAa7JBurTGt+WVkok7/471/zGtdY+Upb3VLFYe61M1sqG9SqlRIrCtA2EdHu7n07bSP",
|
|
"7X6wqPiKfe0FYQyykYNqvCbiqrtdY6LV1/71edcdQ3z1vnVDk6bBE9G/eqTs6EavUfjQTdXhNP+LH/n1",
|
|
"HWA7H0hhT/vjy03lbT+mtqDF2/bH0J55/yYdT3ZNfro2o7c+iv7dkjnMNg9IOg5sh2B0YBnCDNOFJK58",
|
|
"IaU+h8NUJo8kUm2T0PGYyVR6K5CWxnSjpx4DFiDOSjXrnf7to8a47cZuP1wK2jvtDXFBhvPvDD24/ay2",
|
|
"bXLJ/S7vPOQVmJKzphRO3Xbe3IZNq1mJQ7Gd1yC0fkuq3lZE2jrLhLPEtzmqFY5yvYxW57zYLtXBzcer",
|
|
"7ItPcbuH2aIrLtS3qDY+oEZ3zuiCQg2KqreC69SYBC+lRP0MUpLBEKeqNi3USzR9aom7NEsLopc+z2oz",
|
|
"hPNt9f26AyZZCjVKgnOsmsp5UVYnChmSjjRcnnBlq6vlOH6Kpl7JxGYsm+9mRCWu+mCCQja+x1SDy2Lg",
|
|
"LrhQq++5Sg6fP37+/wEAAP//VvsxiT/wAAA=",
|
|
}
|
|
|
|
// 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
|
|
}
|