Skip to content
This repository has been archived by the owner on Nov 24, 2024. It is now read-only.

Commit

Permalink
fix: adjust warning definitions within templates
Browse files Browse the repository at this point in the history
  • Loading branch information
bill-ezhao committed Jun 27, 2024
1 parent 7f23829 commit 5a4aa17
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion sdk/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
30 changes: 17 additions & 13 deletions sdk/template_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5a4aa17

Please sign in to comment.