diff --git a/sdk/template.go b/sdk/template.go index 1e1e8e1..695b073 100644 --- a/sdk/template.go +++ b/sdk/template.go @@ -13,7 +13,7 @@ type Template struct { Generation string `json:"generation,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` //nolint:tagliatelle Versions []TemplateVersion `json:"versions,omitempty"` - Warnings []string `json:"warnings,omitempty"` + Warning Warning `json:"warning,omitempty"` } type Templates struct { diff --git a/sdk/template_version.go b/sdk/template_version.go index aa90166..ea99719 100644 --- a/sdk/template_version.go +++ b/sdk/template_version.go @@ -8,19 +8,23 @@ import ( // TemplateVersion is a Sendgrid transactional template version. type TemplateVersion struct { - ID string `json:"id,omitempty"` - TemplateID string `json:"template_id,omitempty"` //nolint:tagliatelle - UpdatedAt string `json:"updated_at,omitempty"` //nolint:tagliatelle - ThumbnailURL string `json:"thumbnail_url,omitempty"` //nolint:tagliatelle - Warnings []string `json:"warnings,omitempty"` - Active int `json:"active,omitempty"` - Name string `json:"name,omitempty"` - HTMLContent string `json:"html_content,omitempty"` //nolint:tagliatelle - PlainContent string `json:"plain_content,omitempty"` //nolint:tagliatelle - GeneratePlainContent bool `json:"generate_plain_content,omitempty"` //nolint:tagliatelle - Subject string `json:"subject,omitempty"` - Editor string `json:"editor,omitempty"` - TestData string `json:"test_data,omitempty"` //nolint:tagliatelle + ID string `json:"id,omitempty"` + TemplateID string `json:"template_id,omitempty"` //nolint:tagliatelle + UpdatedAt string `json:"updated_at,omitempty"` //nolint:tagliatelle + ThumbnailURL string `json:"thumbnail_url,omitempty"` //nolint:tagliatelle + Warnings []Warning `json:"warning,omitempty"` + Active int `json:"active,omitempty"` + Name string `json:"name,omitempty"` + HTMLContent string `json:"html_content,omitempty"` //nolint:tagliatelle + PlainContent string `json:"plain_content,omitempty"` //nolint:tagliatelle + GeneratePlainContent bool `json:"generate_plain_content,omitempty"` //nolint:tagliatelle + Subject string `json:"subject,omitempty"` + Editor string `json:"editor,omitempty"` + TestData string `json:"test_data,omitempty"` //nolint:tagliatelle +} + +type Warning struct { + Message string `json:"message,omitempty"` } func parseTemplateVersion(respBody string) (*TemplateVersion, error) {