// Package generated provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.
package generated

const (
	ExternalCallbackSignatureScopes = "ExternalCallbackSignature.Scopes"
	GitHubWebhookSignatureScopes    = "GitHubWebhookSignature.Scopes"
)

// Defines values for ExternalCallbackAcceptedStatus.
const (
	ExternalCallbackAcceptedStatusAccepted          ExternalCallbackAcceptedStatus = "accepted"
	ExternalCallbackAcceptedStatusDuplicateAccepted ExternalCallbackAcceptedStatus = "duplicate_accepted"
)

// Defines values for ProviderWebhookAcceptedStatus.
const (
	ProviderWebhookAcceptedStatusAccepted          ProviderWebhookAcceptedStatus = "accepted"
	ProviderWebhookAcceptedStatusDuplicateAccepted ProviderWebhookAcceptedStatus = "duplicate_accepted"
)

// Defines values for SafeErrorCode.
const (
	SafeErrorCodeBackpressure          SafeErrorCode = "backpressure"
	SafeErrorCodeDownstreamUnavailable SafeErrorCode = "downstream_unavailable"
	SafeErrorCodeInvalidRequest        SafeErrorCode = "invalid_request"
	SafeErrorCodePayloadTooLarge       SafeErrorCode = "payload_too_large"
	SafeErrorCodeRateLimited           SafeErrorCode = "rate_limited"
	SafeErrorCodeSignatureInvalid      SafeErrorCode = "signature_invalid"
	SafeErrorCodeSourceNotAllowed      SafeErrorCode = "source_not_allowed"
)

// ExternalCallbackAccepted defines model for ExternalCallbackAccepted.
type ExternalCallbackAccepted struct {
	CallbackId     string  `json:"callback_id"`
	CallbackSource string  `json:"callback_source"`
	CorrelationId  string  `json:"correlation_id"`
	DeliveryId     *string `json:"delivery_id,omitempty"`

	// OwnerService Owner service selected by route registry.
	OwnerService *string                        `json:"owner_service,omitempty"`
	RequestId    string                         `json:"request_id"`
	RequestRef   *string                        `json:"request_ref,omitempty"`
	Status       ExternalCallbackAcceptedStatus `json:"status"`
}

// ExternalCallbackAcceptedStatus defines model for ExternalCallbackAccepted.Status.
type ExternalCallbackAcceptedStatus string

// ExternalCallbackObjectRef Safe object reference for sanitized callback content outside the gateway.
type ExternalCallbackObjectRef struct {
	ObjectDigest    string `json:"object_digest"`
	ObjectSizeBytes *int64 `json:"object_size_bytes,omitempty"`
	ObjectUri       string `json:"object_uri"`
}

// ExternalChannelCallbackRequest Safe generic callback envelope accepted by integration-gateway and forwarded to interaction-hub.
type ExternalChannelCallbackRequest struct {
	// Action Owner-defined action key selected by the actor.
	Action string `json:"action"`

	// ActorRef Verified external actor or subject ref, without PII.
	ActorRef *string `json:"actor_ref,omitempty"`

	// AnswerObject Safe object reference for sanitized callback content outside the gateway.
	AnswerObject *ExternalCallbackObjectRef `json:"answer_object,omitempty"`

	// AnswerSummary Bounded safe answer summary. Raw transcripts and provider payloads are not allowed.
	AnswerSummary *string `json:"answer_summary,omitempty"`

	// CallbackId Idempotency key for interaction-hub callback processing.
	CallbackId      string `json:"callback_id"`
	ContractVersion string `json:"contract_version"`

	// CorrelationId Optional caller correlation id; gateway uses request_id when absent.
	CorrelationId *string `json:"correlation_id,omitempty"`

	// DeliveryId Safe delivery id when the channel callback is tied to a delivery attempt.
	DeliveryId *string `json:"delivery_id,omitempty"`

	// RequestRef Safe interaction request ref when delivery_id is unavailable.
	RequestRef *string `json:"request_ref,omitempty"`
}

// ExternalJsonPayload Raw JSON payload intended for the owner service. Gateway must not log it in full.
type ExternalJsonPayload map[string]interface{}

// ProviderWebhookAccepted defines model for ProviderWebhookAccepted.
type ProviderWebhookAccepted struct {
	CorrelationId string `json:"correlation_id"`
	DeliveryId    string `json:"delivery_id"`
	EventName     string `json:"event_name"`

	// ProviderHubWebhookEventId Stored webhook id returned by provider-hub when available.
	ProviderHubWebhookEventId *string                       `json:"provider_hub_webhook_event_id,omitempty"`
	ProviderSlug              string                        `json:"provider_slug"`
	RequestId                 string                        `json:"request_id"`
	Status                    ProviderWebhookAcceptedStatus `json:"status"`
}

// ProviderWebhookAcceptedStatus defines model for ProviderWebhookAccepted.Status.
type ProviderWebhookAcceptedStatus string

// SafeError defines model for SafeError.
type SafeError struct {
	Code          SafeErrorCode `json:"code"`
	CorrelationId *string       `json:"correlation_id,omitempty"`
	Message       string        `json:"message"`
	RequestId     string        `json:"request_id"`
	Retryable     bool          `json:"retryable"`
}

// SafeErrorCode defines model for SafeError.Code.
type SafeErrorCode string

// CallbackSource defines model for CallbackSource.
type CallbackSource = string

// ExternalDeliveryHeader defines model for ExternalDeliveryHeader.
type ExternalDeliveryHeader = string

// ExternalSignatureHeader defines model for ExternalSignatureHeader.
type ExternalSignatureHeader = string

// GitHubDeliveryHeader defines model for GitHubDeliveryHeader.
type GitHubDeliveryHeader = string

// GitHubEventHeader defines model for GitHubEventHeader.
type GitHubEventHeader = string

// GitHubSignatureHeader defines model for GitHubSignatureHeader.
type GitHubSignatureHeader = string

// ProviderSlug defines model for ProviderSlug.
type ProviderSlug = string

// RequestIdHeader defines model for RequestIdHeader.
type RequestIdHeader = string

// Backpressure defines model for Backpressure.
type Backpressure = SafeError

// BadRequest defines model for BadRequest.
type BadRequest = SafeError

// PayloadTooLarge defines model for PayloadTooLarge.
type PayloadTooLarge = SafeError

// RateLimited defines model for RateLimited.
type RateLimited = SafeError

// Unauthorized defines model for Unauthorized.
type Unauthorized = SafeError

// IngestExternalCallbackParams defines parameters for IngestExternalCallback.
type IngestExternalCallbackParams struct {
	// XKodexRequestId Optional caller-supplied request id. Gateway may replace invalid values.
	XKodexRequestId *RequestIdHeader `json:"X-Kodex-Request-Id,omitempty"`

	// XKodexExternalDelivery Optional external callback idempotency key. When present it must match callback_id in the JSON body.
	XKodexExternalDelivery *ExternalDeliveryHeader `json:"X-Kodex-External-Delivery,omitempty"`

	// XKodexExternalSignature Generic HMAC SHA-256 callback signature. It must be redacted before logs, metrics and errors.
	XKodexExternalSignature *ExternalSignatureHeader `json:"X-Kodex-External-Signature,omitempty"`
}

// IngestProviderWebhookParams defines parameters for IngestProviderWebhook.
type IngestProviderWebhookParams struct {
	// XKodexRequestId Optional caller-supplied request id. Gateway may replace invalid values.
	XKodexRequestId *RequestIdHeader `json:"X-Kodex-Request-Id,omitempty"`

	// XGitHubDelivery GitHub delivery id used as provider webhook idempotency key.
	XGitHubDelivery GitHubDeliveryHeader `json:"X-GitHub-Delivery"`

	// XGitHubEvent GitHub event name.
	XGitHubEvent GitHubEventHeader `json:"X-GitHub-Event"`

	// XHubSignature256 GitHub HMAC SHA-256 signature.
	XHubSignature256 *GitHubSignatureHeader `json:"X-Hub-Signature-256,omitempty"`
}

// IngestExternalCallbackJSONRequestBody defines body for IngestExternalCallback for application/json ContentType.
type IngestExternalCallbackJSONRequestBody = ExternalChannelCallbackRequest

// IngestProviderWebhookJSONRequestBody defines body for IngestProviderWebhook for application/json ContentType.
type IngestProviderWebhookJSONRequestBody = ExternalJsonPayload
