|
1 | 1 | package helper |
2 | 2 |
|
3 | 3 | type KratosHttpResponseBody struct { |
4 | | - ID string `json:"id"` |
5 | | - Type string `json:"type"` |
6 | | - ExpiresAt string `json:"expires_at"` |
7 | | - IssuedAt string `json:"issued_at"` |
8 | | - RequestURL string `json:"request_url"` |
9 | | - UI KratosHttpReponseUI `json:"ui"` |
10 | | - OrganizationID *string `json:"organization_id"` |
11 | | - State string `json:"state"` |
| 4 | + ID string `json:"id"` |
| 5 | + Type string `json:"type"` |
| 6 | + ExpiresAt string `json:"expires_at"` |
| 7 | + IssuedAt string `json:"issued_at"` |
| 8 | + RequestURL string `json:"request_url"` |
| 9 | + UI KratosHttpResponseUI `json:"ui"` |
| 10 | + OrganizationID *string `json:"organization_id"` |
| 11 | + State string `json:"state"` |
| 12 | + Active string `json:"active,omitempty"` |
| 13 | + TransientPayload interface{} `json:"transient_payload,omitempty"` |
12 | 14 | } |
13 | 15 |
|
14 | | -type KratosHttpReponseUI struct { |
15 | | - Action string `json:"action"` |
16 | | - Method string `json:"method"` |
17 | | - Nodes []KratosHttpResponseNode `json:"nodes"` |
18 | | - Messages []KratosHttpReponseMessage `json:"messages"` |
| 16 | +type KratosHttpResponseUI struct { |
| 17 | + Action string `json:"action"` |
| 18 | + Method string `json:"method"` |
| 19 | + Nodes []KratosHttpResponseNode `json:"nodes"` |
| 20 | + Messages []KratosHttpResponseMessage `json:"messages"` |
19 | 21 | } |
20 | 22 |
|
21 | 23 | type KratosHttpResponseNode struct { |
22 | 24 | Type string `json:"type"` |
23 | 25 | Group string `json:"group"` |
24 | 26 | Attributes KratosHttpResponseAttributes `json:"attributes"` |
25 | | - Messages []KratosHttpReponseMessage `json:"messages"` |
| 27 | + Messages []KratosHttpResponseMessage `json:"messages"` |
26 | 28 | Meta KratosHttpResponseMeta `json:"meta"` |
27 | 29 | } |
28 | 30 |
|
29 | 31 | type KratosHttpResponseAttributes struct { |
30 | 32 | Name string `json:"name"` |
31 | 33 | Type string `json:"type"` |
32 | | - Value interface{} `json:"value"` // Can be string, boolean, or other types |
| 34 | + Value interface{} `json:"value"` |
33 | 35 | Required bool `json:"required,omitempty"` |
34 | 36 | Disabled bool `json:"disabled,omitempty"` |
35 | 37 | NodeType string `json:"node_type"` |
36 | 38 | Autocomplete string `json:"autocomplete,omitempty"` |
| 39 | + Maxlength int `json:"maxlength,omitempty"` |
| 40 | + Pattern string `json:"pattern,omitempty"` |
37 | 41 | } |
38 | 42 |
|
39 | | -type KratosHttpReponseMessage struct { |
| 43 | +type KratosHttpResponseMessage struct { |
40 | 44 | ID int `json:"id"` |
41 | 45 | Text string `json:"text"` |
42 | 46 | Type string `json:"type"` |
43 | | - Context map[string]interface{} `json:"context"` |
| 47 | + Context map[string]interface{} `json:"context,omitempty"` |
44 | 48 | } |
45 | 49 |
|
46 | 50 | type KratosHttpResponseMeta struct { |
47 | | - Label *KratosHttpResponseLabel `json:"label"` |
| 51 | + Label *KratosHttpResponseLabel `json:"label,omitempty"` |
48 | 52 | } |
49 | 53 |
|
50 | 54 | type KratosHttpResponseLabel struct { |
51 | 55 | ID int `json:"id"` |
52 | 56 | Text string `json:"text"` |
53 | 57 | Type string `json:"type"` |
54 | | - Context map[string]interface{} `json:"context"` |
| 58 | + Context map[string]interface{} `json:"context,omitempty"` |
55 | 59 | } |
0 commit comments