218 lines
7.5 KiB
Go
218 lines
7.5 KiB
Go
package management
|
|
|
|
import "time"
|
|
|
|
const (
|
|
ModeMock = "mock"
|
|
ModeReal = "real"
|
|
)
|
|
|
|
type ProviderInput struct {
|
|
DisplayName string `json:"display_name"`
|
|
Notes string `json:"notes,omitempty"`
|
|
Lifecycle string `json:"lifecycle"`
|
|
}
|
|
|
|
type Provider struct {
|
|
ProviderID string `json:"provider_id"`
|
|
DisplayName string `json:"display_name"`
|
|
Notes string `json:"notes,omitempty"`
|
|
Lifecycle string `json:"lifecycle"`
|
|
Revision int64 `json:"revision"`
|
|
TrunkCount int `json:"trunk_count"`
|
|
CreatedAt string `json:"created_at"`
|
|
UpdatedAt string `json:"updated_at"`
|
|
UpdatedBy string `json:"updated_by"`
|
|
}
|
|
|
|
type SipConfig struct {
|
|
Host string `json:"host"`
|
|
Port int `json:"port"`
|
|
Transport string `json:"transport"`
|
|
AuthMode string `json:"auth_mode"`
|
|
Register bool `json:"register"`
|
|
CredentialRef string `json:"credential_ref,omitempty"`
|
|
}
|
|
|
|
type CodecProfile struct {
|
|
Allowed []string `json:"allowed"`
|
|
Preferred string `json:"preferred"`
|
|
}
|
|
|
|
type TrunkConfig struct {
|
|
ProviderID string `json:"provider_id"`
|
|
DisplayName string `json:"display_name"`
|
|
Enabled bool `json:"enabled"`
|
|
Sip SipConfig `json:"sip"`
|
|
CodecProfile CodecProfile `json:"codec_profile"`
|
|
CallerIDs []string `json:"caller_ids"`
|
|
DialPrefix string `json:"dial_prefix"`
|
|
EgressPoolID string `json:"egress_pool_id"`
|
|
MaxConcurrency int `json:"max_concurrency"`
|
|
MaxCPS int `json:"max_cps"`
|
|
}
|
|
|
|
type CellConfig struct {
|
|
EgressPoolID string `json:"egress_pool_id"`
|
|
CodecCapabilities []string `json:"codec_capabilities"`
|
|
Status string `json:"status"`
|
|
MaxConcurrency int `json:"max_concurrency"`
|
|
ManagementURL string `json:"management_url,omitempty"`
|
|
}
|
|
|
|
type Cell struct {
|
|
Mode string `json:"mode"`
|
|
CellID string `json:"cell_id"`
|
|
Revision int64 `json:"revision"`
|
|
Config CellConfig `json:"config"`
|
|
CloudInstanceID string `json:"cloud_instance_id,omitempty"`
|
|
InstanceName string `json:"instance_name,omitempty"`
|
|
Region string `json:"region,omitempty"`
|
|
BootID string `json:"boot_id,omitempty"`
|
|
UpdatedAt string `json:"updated_at"`
|
|
UpdatedBy string `json:"updated_by"`
|
|
}
|
|
|
|
type RevisionInfo struct {
|
|
Revision int64 `json:"revision"`
|
|
State string `json:"state"`
|
|
ConfigSHA256 string `json:"config_sha256,omitempty"`
|
|
CreatedAt string `json:"created_at"`
|
|
CreatedBy string `json:"created_by"`
|
|
}
|
|
|
|
type TrunkView struct {
|
|
TrunkConfig
|
|
TrunkID string `json:"trunk_id"`
|
|
CredentialConfigured bool `json:"credential_configured"`
|
|
AsteriskAllow []string `json:"asterisk_allow"`
|
|
ConfigSHA256 string `json:"config_sha256,omitempty"`
|
|
}
|
|
|
|
type AdminTrunk struct {
|
|
Mode string `json:"mode"`
|
|
TrunkID string `json:"trunk_id"`
|
|
ProviderID string `json:"provider_id"`
|
|
LatestRevision int64 `json:"latest_revision"`
|
|
ActiveRevision int64 `json:"active_revision"`
|
|
ActiveStatus string `json:"active_status"`
|
|
Status string `json:"status"`
|
|
UpdatedAt string `json:"updated_at"`
|
|
CompatibleCellIDs []string `json:"compatible_cell_ids"`
|
|
Latest *TrunkView `json:"latest"`
|
|
Active *TrunkView `json:"active"`
|
|
Versions []RevisionInfo `json:"versions"`
|
|
}
|
|
|
|
type ReadonlyTrunk struct {
|
|
Mode string `json:"mode"`
|
|
TrunkID string `json:"trunk_id"`
|
|
ProviderID string `json:"provider_id"`
|
|
Revision int64 `json:"revision"`
|
|
Status string `json:"status"`
|
|
UpdatedAt string `json:"updated_at"`
|
|
Config *TrunkView `json:"config"`
|
|
}
|
|
|
|
type Publication struct {
|
|
TrunkID string `json:"trunk_id"`
|
|
Revision int64 `json:"revision"`
|
|
CellID string `json:"cell_id"`
|
|
Status string `json:"status"`
|
|
ErrorCode *string `json:"error_code"`
|
|
AppliedAt *string `json:"applied_at,omitempty"`
|
|
TargetDigest string `json:"target_digest,omitempty"`
|
|
LocalRevision int64 `json:"local_revision,omitempty"`
|
|
LocalDigest string `json:"local_digest,omitempty"`
|
|
UpdatedAt string `json:"updated_at"`
|
|
OperationID string `json:"operation_id,omitempty"`
|
|
}
|
|
|
|
type AuditEntry struct {
|
|
AuditID string `json:"audit_id"`
|
|
ResourceType string `json:"resource_type"`
|
|
ResourceID string `json:"resource_id"`
|
|
Action string `json:"action"`
|
|
Revision int64 `json:"revision"`
|
|
Actor string `json:"actor"`
|
|
RequestID *string `json:"request_id"`
|
|
DetailsJSON string `json:"details_json"`
|
|
CreatedAt string `json:"created_at"`
|
|
}
|
|
|
|
type ObservationInput struct {
|
|
ObservationID string `json:"observation_id"`
|
|
CellID string `json:"cell_id"`
|
|
TrunkID string `json:"trunk_id,omitempty"`
|
|
BootID string `json:"boot_id"`
|
|
Sequence int64 `json:"sequence"`
|
|
ObservedAt time.Time `json:"observed_at"`
|
|
ReceivedAt time.Time `json:"received_at"`
|
|
Source string `json:"source"`
|
|
ConfigRevision int64 `json:"config_revision"`
|
|
States map[string]any `json:"states"`
|
|
Occupancy map[string]any `json:"occupancy,omitempty"`
|
|
SampleID string `json:"sample_id,omitempty"`
|
|
}
|
|
|
|
type Attempt struct {
|
|
AttemptID string `json:"attempt_id"`
|
|
ExecutionID string `json:"execution_id,omitempty"`
|
|
CallID string `json:"call_id,omitempty"`
|
|
TenantKey string `json:"tenant_key,omitempty"`
|
|
ProviderID string `json:"provider_id,omitempty"`
|
|
TrunkID string `json:"trunk_id,omitempty"`
|
|
CellID string `json:"cell_id,omitempty"`
|
|
EgressPoolID string `json:"egress_pool_id,omitempty"`
|
|
ConfigRevision int64 `json:"config_revision,omitempty"`
|
|
Mode string `json:"mode"`
|
|
DialedNumber string `json:"dialed_number,omitempty"`
|
|
AttemptStartedAt *time.Time `json:"attempt_started_at,omitempty"`
|
|
OriginStatus string `json:"origin_status"`
|
|
AnsweredAt *time.Time `json:"answered_at,omitempty"`
|
|
EndedAt *time.Time `json:"ended_at,omitempty"`
|
|
TerminationReason string `json:"termination_reason"`
|
|
SIPCode *int `json:"sip_code,omitempty"`
|
|
Q850 string `json:"q850,omitempty"`
|
|
AIStatus string `json:"ai_status,omitempty"`
|
|
Source string `json:"source"`
|
|
FactVersion int64 `json:"fact_version"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type ErrorBody struct {
|
|
Code string `json:"code"`
|
|
Message string `json:"message"`
|
|
Fields map[string]any `json:"fields,omitempty"`
|
|
RequestID string `json:"request_id,omitempty"`
|
|
}
|
|
|
|
type errorResponse struct {
|
|
Error ErrorBody `json:"error"`
|
|
}
|
|
|
|
type VerificationInput struct {
|
|
CheckName string `json:"check_name"`
|
|
Result string `json:"result"`
|
|
EvidenceRef string `json:"evidence_ref,omitempty"`
|
|
CheckedBy string `json:"checked_by"`
|
|
}
|
|
|
|
type Operation struct {
|
|
OperationID string
|
|
Actor string
|
|
Action string
|
|
ResourceType string
|
|
ResourceID string
|
|
RequestID string
|
|
RequestDigest string
|
|
ExpectedRevision int64
|
|
State string
|
|
HTTPStatus int
|
|
ResponseJSON string
|
|
ErrorJSON string
|
|
CreatedAt string
|
|
UpdatedAt string
|
|
ExpiresAt string
|
|
}
|