forked from NdoleStudio/httpsms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphone_api_key.go
More file actions
29 lines (24 loc) · 1.37 KB
/
Copy pathphone_api_key.go
File metadata and controls
29 lines (24 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package entities
import (
"time"
"github.com/google/uuid"
"github.com/lib/pq"
)
// EntityNamePhoneAPIKey is the entitlement entity name for phone API keys.
const EntityNamePhoneAPIKey = "PhoneAPIKey"
// PhoneAPIKey represents the API key for a phone
type PhoneAPIKey struct {
ID uuid.UUID `json:"id" gorm:"primaryKey;type:uuid;" example:"32343a19-da5e-4b1b-a767-3298a73703cb"`
Name string `json:"name" example:"Business Phone Key"`
UserID UserID `json:"user_id" example:"WB7DRDWrJZRGbYrv2CKGkqbzvqdC"`
UserEmail string `json:"user_email" example:"user@gmail.com"`
PhoneNumbers pq.StringArray `json:"phone_numbers" example:"+18005550199,+18005550100" gorm:"type:text[]" swaggertype:"array,string"`
PhoneIDs pq.StringArray `json:"phone_ids" example:"32343a19-da5e-4b1b-a767-3298a73703cb,32343a19-da5e-4b1b-a767-3298a73703cc" gorm:"type:text[]" swaggertype:"array,string"`
APIKey string `json:"api_key" gorm:"uniqueIndex:idx_phone_api_key__api_key;NOT NULL" example:"pk_DGW8NwQp7mxKaSZ72Xq9v6xxxxx"`
CreatedAt time.Time `json:"created_at" example:"2022-06-05T14:26:02.302718+03:00"`
UpdatedAt time.Time `json:"updated_at" example:"2022-06-05T14:26:02.302718+03:00"`
}
// TableName overrides the table name used by PhoneAPIKey
func (PhoneAPIKey) TableName() string {
return "phone_api_keys"
}