From 35957ff156ce570b452acca50abc4a838d47b63f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=B0=D0=BD=D0=BE=D0=B2=20=D0=94=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=BB=D0=B0?= Date: Mon, 16 Oct 2023 15:35:02 +0300 Subject: [PATCH] add rejected_reason and verification_status fields for template --- v1/template.go | 24 +++++++++++++----------- v1/template_test.go | 4 +++- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/v1/template.go b/v1/template.go index 264a43c..4af249d 100644 --- a/v1/template.go +++ b/v1/template.go @@ -37,17 +37,19 @@ var templateVarAssoc = map[string]interface{}{ // Template struct. type Template struct { - Code string `json:"code"` - ChannelID uint64 `json:"channel_id,omitempty"` - Name string `json:"name"` - Enabled bool `json:"enabled,omitempty"` - Type string `json:"type"` - Template []TemplateItem `json:"template"` - HeaderParams *HeaderParams `json:"headerParams,omitempty"` - Footer *string `json:"footer,omitempty"` - ButtonParams []ButtonParam `json:"buttonParams,omitempty"` - Lang string `json:"lang,omitempty"` - Category string `json:"category,omitempty"` + Code string `json:"code"` + ChannelID uint64 `json:"channel_id,omitempty"` + Name string `json:"name"` + Enabled bool `json:"enabled,omitempty"` + Type string `json:"type"` + Template []TemplateItem `json:"template"` + HeaderParams *HeaderParams `json:"headerParams,omitempty"` + Footer *string `json:"footer,omitempty"` + ButtonParams []ButtonParam `json:"buttonParams,omitempty"` + Lang string `json:"lang,omitempty"` + Category string `json:"category,omitempty"` + RejectedReason string `json:"rejected_reason,omitempty"` + VerificationStatus string `json:"verification_status,omitempty"` } // TemplateItem is a part of template. diff --git a/v1/template_test.go b/v1/template_test.go index 7303b8d..1caf975 100644 --- a/v1/template_test.go +++ b/v1/template_test.go @@ -89,7 +89,9 @@ func TestUnmarshalMediaInteractiveTemplate(t *testing.T) { "type": "QUICK_REPLY", "text": "Yes" } - ] + ], + "rejected_reason": "NONE", + "status": "APPROVED" }` assert.NoError(t, json.Unmarshal([]byte(input), &template))