196b543bee
CI / build-and-test (push) Successful in 1m47s
* Implement tenant and user creation in IdentityPage * Add API calls for managing tenants and users * Introduce tenant-scoped API requests * Update sidebar to include identity navigation * Create BooleanStatusBadge component for key status
67 lines
2.9 KiB
Go
67 lines
2.9 KiB
Go
// Code generated by relspecgo. DO NOT EDIT.
|
|
package generatedmodels
|
|
|
|
import (
|
|
sql_types "git.warky.dev/wdevs/relspecgo/pkg/sqltypes"
|
|
"github.com/uptrace/bun"
|
|
)
|
|
|
|
type ModelPublicAPIKeyAssignments struct {
|
|
bun.BaseModel `bun:"table:public.api_key_assignments,alias:api_key_assignments"`
|
|
KeyID sql_types.SqlString `bun:"key_id,type:text,pk," json:"key_id"`
|
|
CreatedAt sql_types.SqlTimeStamp `bun:"created_at,type:timestamptz,default:now(),notnull," json:"created_at"`
|
|
Description sql_types.SqlString `bun:"description,type:text,default:'',notnull," json:"description"`
|
|
Enabled bool `bun:"enabled,type:boolean,default:true,notnull," json:"enabled"`
|
|
Source sql_types.SqlString `bun:"source,type:text,notnull," json:"source"`
|
|
TenantID sql_types.SqlString `bun:"tenant_id,type:text,notnull," json:"tenant_id"`
|
|
UserID sql_types.SqlString `bun:"user_id,type:text,nullzero," json:"user_id"`
|
|
RelTenantID *ModelPublicTenants `bun:"rel:has-one,join:tenant_id=id" json:"reltenantid,omitempty"` // Has one ModelPublicTenants
|
|
RelUserID *ModelPublicTenantUsers `bun:"rel:has-one,join:user_id=id" json:"reluserid,omitempty"` // Has one ModelPublicTenantUsers
|
|
RelKeyIDPublicManagedAPIKeys []*ModelPublicManagedAPIKeys `bun:"rel:has-many,join:key_id=key_id" json:"relkeyidpublicmanagedapikeys,omitempty"` // Has many ModelPublicManagedAPIKeys
|
|
}
|
|
|
|
// TableName returns the table name for ModelPublicAPIKeyAssignments
|
|
func (m ModelPublicAPIKeyAssignments) TableName() string {
|
|
return "public.api_key_assignments"
|
|
}
|
|
|
|
// TableNameOnly returns the table name without schema for ModelPublicAPIKeyAssignments
|
|
func (m ModelPublicAPIKeyAssignments) TableNameOnly() string {
|
|
return "api_key_assignments"
|
|
}
|
|
|
|
// SchemaName returns the schema name for ModelPublicAPIKeyAssignments
|
|
func (m ModelPublicAPIKeyAssignments) SchemaName() string {
|
|
return "public"
|
|
}
|
|
|
|
// GetID returns the primary key value
|
|
func (m ModelPublicAPIKeyAssignments) GetID() string {
|
|
return m.KeyID.String()
|
|
}
|
|
|
|
// GetIDStr returns the primary key as a string
|
|
func (m ModelPublicAPIKeyAssignments) GetIDStr() string {
|
|
return m.KeyID.String()
|
|
}
|
|
|
|
// SetID sets the primary key value
|
|
func (m ModelPublicAPIKeyAssignments) SetID(newid string) {
|
|
m.UpdateID(newid)
|
|
}
|
|
|
|
// UpdateID updates the primary key value
|
|
func (m *ModelPublicAPIKeyAssignments) UpdateID(newid string) {
|
|
m.KeyID.FromString(newid)
|
|
}
|
|
|
|
// GetIDName returns the name of the primary key column
|
|
func (m ModelPublicAPIKeyAssignments) GetIDName() string {
|
|
return "key_id"
|
|
}
|
|
|
|
// GetPrefix returns the table prefix
|
|
func (m ModelPublicAPIKeyAssignments) GetPrefix() string {
|
|
return "AKA"
|
|
}
|