1
0
mirror of synced 2024-11-25 06:26:03 +03:00

add rejected_reason and verification_status fields for template

This commit is contained in:
Pavel 2023-10-16 15:45:51 +03:00 committed by GitHub
commit a29500a6aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 12 deletions

View File

@ -37,17 +37,19 @@ var templateVarAssoc = map[string]interface{}{
// Template struct. // Template struct.
type Template struct { type Template struct {
Code string `json:"code"` Code string `json:"code"`
ChannelID uint64 `json:"channel_id,omitempty"` ChannelID uint64 `json:"channel_id,omitempty"`
Name string `json:"name"` Name string `json:"name"`
Enabled bool `json:"enabled,omitempty"` Enabled bool `json:"enabled,omitempty"`
Type string `json:"type"` Type string `json:"type"`
Template []TemplateItem `json:"template"` Template []TemplateItem `json:"template"`
HeaderParams *HeaderParams `json:"headerParams,omitempty"` HeaderParams *HeaderParams `json:"headerParams,omitempty"`
Footer *string `json:"footer,omitempty"` Footer *string `json:"footer,omitempty"`
ButtonParams []ButtonParam `json:"buttonParams,omitempty"` ButtonParams []ButtonParam `json:"buttonParams,omitempty"`
Lang string `json:"lang,omitempty"` Lang string `json:"lang,omitempty"`
Category string `json:"category,omitempty"` Category string `json:"category,omitempty"`
RejectedReason string `json:"rejected_reason,omitempty"`
VerificationStatus string `json:"verification_status,omitempty"`
} }
// TemplateItem is a part of template. // TemplateItem is a part of template.

View File

@ -89,7 +89,9 @@ func TestUnmarshalMediaInteractiveTemplate(t *testing.T) {
"type": "QUICK_REPLY", "type": "QUICK_REPLY",
"text": "Yes" "text": "Yes"
} }
] ],
"rejected_reason": "NONE",
"status": "APPROVED"
}` }`
assert.NoError(t, json.Unmarshal([]byte(input), &template)) assert.NoError(t, json.Unmarshal([]byte(input), &template))