Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
// Code generated by oapi-codegen. DO NOT EDIT.
package shared
import (
"fmt"
"github.com/doordash-oss/oapi-codegen-dd/v3/pkg/runtime"
apivalidator "github.com/infisical/api/internal/server/api/validator"
)
type Error struct {
// ReqID Request ID for tracing
ReqID string `json:"reqId" validate:"required"`
// StatusCode HTTP status code
StatusCode int `json:"statusCode"`
// ErrorData Error type/name
ErrorData string `json:"error" validate:"required"`
Message string `json:"message" validate:"required"`
Details map[string]any `json:"details,omitempty"`
}
func (e Error) Validate() error {
return runtime.ConvertValidatorError(typesValidator.Struct(e))
}
type ValidationError struct {
// ReqID Request ID for tracing
ReqID string `json:"reqId" validate:"required"`
// StatusCode HTTP status code
StatusCode int `json:"statusCode"`
// ErrorData Error type/name
ErrorData string `json:"error" validate:"required"`
Message string `json:"message" validate:"required"`
Details map[string]any `json:"details,omitempty"`
FieldErrors []FieldError `json:"fieldErrors,omitempty"`
}
func (v ValidationError) Validate() error {
var errors runtime.ValidationErrors
if err := typesValidator.Var(v.ReqID, "required"); err != nil {
errors = errors.Append("ReqID", err)
}
if err := typesValidator.Var(v.ErrorData, "required"); err != nil {
errors = errors.Append("ErrorData", err)
}
if err := typesValidator.Var(v.Message, "required"); err != nil {
errors = errors.Append("Message", err)
}
for i, item := range v.FieldErrors {
if v, ok := any(item).(runtime.Validator); ok {
if err := v.Validate(); err != nil {
errors = errors.Append(fmt.Sprintf("FieldErrors[%d]", i), err)
}
}
}
if len(errors) == 0 {
return nil
}
return errors
}
type FieldError struct {
Field string `json:"field" validate:"required"`
Message string `json:"message" validate:"required"`
}
func (f FieldError) Validate() error {
return runtime.ConvertValidatorError(typesValidator.Struct(f))
}
type PaginationMeta struct {
Page int `json:"page"`
PerPage int `json:"perPage"`
Total int `json:"total"`
TotalPages *int `json:"totalPages,omitempty"`
}
var typesValidator = apivalidator.V