openapi

package
v4.0.0-rc.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 6 Imported by: 0

README

Go API client for

The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as "active" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active.

This API provides operations to create and manage your templates as well as their versions.

Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts.

Overview

This API client was generated by the OpenAPI Generator project from the OpenAPI specs located at twilio/sendgrid-oai. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 1.0.0
  • Package version:
  • Build date: 2024-10-24T13:26:06.797415Z[Etc/UTC]
  • Build package: com.sendgrid.oai.go.SendgridGoGenerator For more information, please visit https://support.sendgrid.com/hc/en-us

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import "./"

Documentation for API Endpoints

All URIs are relative to https://api.sendgrid.com

Class Method HTTP request Description
ActivateTemplateVersion ActivateTemplateVersion Post /v3/templates/{TemplateId}/versions/{VersionId}/activate Activate a transactional template version.
CreateTemplate CreateTemplate Post /v3/templates Create a transactional template.
CreateTemplateVersion CreateTemplateVersion Post /v3/templates/{TemplateId}/versions Create a new transactional template version.
DeleteTemplate DeleteTemplate Delete /v3/templates/{TemplateId} Delete a template.
DeleteTemplateVersion DeleteTemplateVersion Delete /v3/templates/{TemplateId}/versions/{VersionId} Delete a transactional template version.
DuplicateTemplate DuplicateTemplate Post /v3/templates/{TemplateId} Duplicate a transactional template.
GetTemplate GetTemplate Get /v3/templates/{TemplateId} Retrieve a single transactional template.
GetTemplateVersion GetTemplateVersion Get /v3/templates/{TemplateId}/versions/{VersionId} Retrieve a specific transactional template version.
ListTemplate ListTemplate Get /v3/templates Retrieve paged transactional templates.
UpdateTemplate UpdateTemplate Patch /v3/templates/{TemplateId} Edit a transactional template.
UpdateTemplateVersion UpdateTemplateVersion Patch /v3/templates/{TemplateId}/versions/{VersionId} Edit a transactional template version.

Documentation For Models

Documentation For Authorization

BearerAuth

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
    UserName: "username",
    Password: "password",
})
r, err := client.Service.Operation(auth, args)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivateTemplateVersionParam

type ActivateTemplateVersionParam struct {
	// The ID of the original template
	TemplateId *string `json:"template_id"`
	// The ID of the template version
	VersionId *string `json:"version_id"`
	// The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id <account-id>`). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: <subuser-username>`). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information.
	Onbehalfof *string `json:"on-behalf-of,omitempty"`
}

func (*ActivateTemplateVersionParam) SetOnbehalfof

func (params *ActivateTemplateVersionParam) SetOnbehalfof(Onbehalfof string) *ActivateTemplateVersionParam

func (*ActivateTemplateVersionParam) SetTemplateId

func (params *ActivateTemplateVersionParam) SetTemplateId(TemplateId string) *ActivateTemplateVersionParam

func (*ActivateTemplateVersionParam) SetVersionId

func (params *ActivateTemplateVersionParam) SetVersionId(VersionId string) *ActivateTemplateVersionParam

type Active

type Active int32

Active the model 'Active'

const (
	ACTIVE__0 Active = 0
	ACTIVE__1 Active = 1
)

List of Active

type Active1

type Active1 int32

Active1 the model 'Active1'

const (
	ACTIVE1__0 Active1 = 0
	ACTIVE1__1 Active1 = 1
)

List of Active1

type ApiService

type ApiService struct {
	// contains filtered or unexported fields
}

func NewApiService

func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService

func NewApiServiceWithClient

func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService

func (*ApiService) ActivateTemplateVersion

func (c *ApiService) ActivateTemplateVersion(params *ActivateTemplateVersionParam) (interface{}, error)

**This endpoint allows you to activate a version of one of your templates.**

func (*ApiService) CreateTemplate

func (c *ApiService) CreateTemplate(params *CreateTemplateParam) (interface{}, error)

**This endpoint allows you to create a transactional template.**

func (*ApiService) CreateTemplateVersion

func (c *ApiService) CreateTemplateVersion(params *CreateTemplateVersionParam) (interface{}, error)

**This endpoint allows you to create a new version of a template.**

func (*ApiService) DeleteTemplate

func (c *ApiService) DeleteTemplate(params *DeleteTemplateParam) (interface{}, error)

**This endpoint allows you to delete a transactional template.**

func (*ApiService) DeleteTemplateVersion

func (c *ApiService) DeleteTemplateVersion(params *DeleteTemplateVersionParam) (interface{}, error)

**This endpoint allows you to delete a transactional template version.**

func (*ApiService) DuplicateTemplate

func (c *ApiService) DuplicateTemplate(params *DuplicateTemplateParam) (interface{}, error)

**This endpoint allows you to duplicate a transactional template.**

func (*ApiService) GetTemplate

func (c *ApiService) GetTemplate(params *GetTemplateParam) (interface{}, error)

**This endpoint allows you to retrieve a single transactional template.**

func (*ApiService) GetTemplateVersion

func (c *ApiService) GetTemplateVersion(params *GetTemplateVersionParam) (interface{}, error)

**This endpoint allows you to retrieve a specific version of a template.**

func (*ApiService) ListTemplate

func (c *ApiService) ListTemplate(params *ListTemplateParam) (interface{}, error)

**This endpoint allows you to retrieve all transactional templates.**

func (*ApiService) UpdateTemplate

func (c *ApiService) UpdateTemplate(params *UpdateTemplateParam) (interface{}, error)

**This endpoint allows you to edit the name of a transactional template.** To edit the template itself, [create a new transactional template version](https://docs.sendgrid.com/api-reference/transactional-templates-versions/create-a-new-transactional-template-version).

func (*ApiService) UpdateTemplateVersion

func (c *ApiService) UpdateTemplateVersion(params *UpdateTemplateVersionParam) (interface{}, error)

**This endpoint allows you to edit the content of your template version.**

type CreateTemplateParam

type CreateTemplateParam struct {
	// The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id <account-id>`). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: <subuser-username>`). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information.
	Onbehalfof *string `json:"on-behalf-of,omitempty"`
	//
	CreateTemplateRequest *CreateTemplateRequest `json:"CreateTemplateRequest,omitempty"`
}

func (*CreateTemplateParam) SetCreateTemplateRequest

func (params *CreateTemplateParam) SetCreateTemplateRequest(CreateTemplateRequest CreateTemplateRequest) *CreateTemplateParam

func (*CreateTemplateParam) SetOnbehalfof

func (params *CreateTemplateParam) SetOnbehalfof(Onbehalfof string) *CreateTemplateParam

type CreateTemplateRequest

type CreateTemplateRequest struct {
	// The name for the new transactional template.
	Name string `json:"name"`
	// Defines whether the template supports dynamic replacement.
	Generation *Generation `json:"generation,omitempty"`
}

CreateTemplateRequest struct for CreateTemplateRequest

type CreateTemplateVersionParam

type CreateTemplateVersionParam struct {
	//
	TemplateId *string `json:"template_id"`
	// The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id <account-id>`). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: <subuser-username>`). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information.
	Onbehalfof *string `json:"on-behalf-of,omitempty"`
	//
	TransactionalTemplateVersionCreate *TransactionalTemplateVersionCreate `json:"TransactionalTemplateVersionCreate,omitempty"`
}

func (*CreateTemplateVersionParam) SetOnbehalfof

func (params *CreateTemplateVersionParam) SetOnbehalfof(Onbehalfof string) *CreateTemplateVersionParam

func (*CreateTemplateVersionParam) SetTemplateId

func (params *CreateTemplateVersionParam) SetTemplateId(TemplateId string) *CreateTemplateVersionParam

func (*CreateTemplateVersionParam) SetTransactionalTemplateVersionCreate

func (params *CreateTemplateVersionParam) SetTransactionalTemplateVersionCreate(TransactionalTemplateVersionCreate TransactionalTemplateVersionCreate) *CreateTemplateVersionParam

type DeleteTemplateParam

type DeleteTemplateParam struct {
	//
	TemplateId *string `json:"template_id"`
	// The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id <account-id>`). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: <subuser-username>`). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information.
	Onbehalfof *string `json:"on-behalf-of,omitempty"`
}

func (*DeleteTemplateParam) SetOnbehalfof

func (params *DeleteTemplateParam) SetOnbehalfof(Onbehalfof string) *DeleteTemplateParam

func (*DeleteTemplateParam) SetTemplateId

func (params *DeleteTemplateParam) SetTemplateId(TemplateId string) *DeleteTemplateParam

type DeleteTemplateVersionParam

type DeleteTemplateVersionParam struct {
	//  The ID of the original template
	TemplateId *string `json:"template_id"`
	// The ID of the template version
	VersionId *string `json:"version_id"`
	// The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id <account-id>`). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: <subuser-username>`). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information.
	Onbehalfof *string `json:"on-behalf-of,omitempty"`
}

func (*DeleteTemplateVersionParam) SetOnbehalfof

func (params *DeleteTemplateVersionParam) SetOnbehalfof(Onbehalfof string) *DeleteTemplateVersionParam

func (*DeleteTemplateVersionParam) SetTemplateId

func (params *DeleteTemplateVersionParam) SetTemplateId(TemplateId string) *DeleteTemplateVersionParam

func (*DeleteTemplateVersionParam) SetVersionId

func (params *DeleteTemplateVersionParam) SetVersionId(VersionId string) *DeleteTemplateVersionParam

type DuplicateTemplateParam

type DuplicateTemplateParam struct {
	//
	TemplateId *string `json:"template_id"`
	// The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id <account-id>`). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: <subuser-username>`). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information.
	Onbehalfof *string `json:"on-behalf-of,omitempty"`
	//
	DuplicateTemplateRequest *DuplicateTemplateRequest `json:"DuplicateTemplateRequest,omitempty"`
}

func (*DuplicateTemplateParam) SetDuplicateTemplateRequest

func (params *DuplicateTemplateParam) SetDuplicateTemplateRequest(DuplicateTemplateRequest DuplicateTemplateRequest) *DuplicateTemplateParam

func (*DuplicateTemplateParam) SetOnbehalfof

func (params *DuplicateTemplateParam) SetOnbehalfof(Onbehalfof string) *DuplicateTemplateParam

func (*DuplicateTemplateParam) SetTemplateId

func (params *DuplicateTemplateParam) SetTemplateId(TemplateId string) *DuplicateTemplateParam

type DuplicateTemplateRequest

type DuplicateTemplateRequest struct {
	// The name for the new transactional template.
	Name *string `json:"name,omitempty"`
}

DuplicateTemplateRequest struct for DuplicateTemplateRequest

type Editor

type Editor string

Editor the model 'Editor'

const (
	EDITOR_CODE   Editor = "code"
	EDITOR_DESIGN Editor = "design"
)

List of Editor

type Editor1

type Editor1 string

Editor1 the model 'Editor1'

const (
	EDITOR1_CODE   Editor1 = "code"
	EDITOR1_DESIGN Editor1 = "design"
)

List of Editor1

type Generation

type Generation string

Generation the model 'Generation'

const (
	GENERATION_LEGACY  Generation = "legacy"
	GENERATION_DYNAMIC Generation = "dynamic"
)

List of Generation

type Generation1

type Generation1 string

Generation1 the model 'Generation1'

const (
	GENERATION1_LEGACY  Generation1 = "legacy"
	GENERATION1_DYNAMIC Generation1 = "dynamic"
)

List of Generation1

type Generations

type Generations string

Generations the model 'Generations'

const (
	GENERATIONS_LEGACY        Generations = "legacy"
	GENERATIONS_DYNAMIC       Generations = "dynamic"
	GENERATIONS_LEGACYDYNAMIC Generations = "legacy,dynamic"
)

List of Generations

type GetTemplateParam

type GetTemplateParam struct {
	//
	TemplateId *string `json:"template_id"`
	// The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id <account-id>`). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: <subuser-username>`). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information.
	Onbehalfof *string `json:"on-behalf-of,omitempty"`
}

func (*GetTemplateParam) SetOnbehalfof

func (params *GetTemplateParam) SetOnbehalfof(Onbehalfof string) *GetTemplateParam

func (*GetTemplateParam) SetTemplateId

func (params *GetTemplateParam) SetTemplateId(TemplateId string) *GetTemplateParam

type GetTemplateVersionParam

type GetTemplateVersionParam struct {
	//  The ID of the original template
	TemplateId *string `json:"template_id"`
	// The ID of the template version
	VersionId *string `json:"version_id"`
	// The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id <account-id>`). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: <subuser-username>`). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information.
	Onbehalfof *string `json:"on-behalf-of,omitempty"`
}

func (*GetTemplateVersionParam) SetOnbehalfof

func (params *GetTemplateVersionParam) SetOnbehalfof(Onbehalfof string) *GetTemplateVersionParam

func (*GetTemplateVersionParam) SetTemplateId

func (params *GetTemplateVersionParam) SetTemplateId(TemplateId string) *GetTemplateVersionParam

func (*GetTemplateVersionParam) SetVersionId

func (params *GetTemplateVersionParam) SetVersionId(VersionId string) *GetTemplateVersionParam

type ListTemplate200Response

type ListTemplate200Response struct {
	//
	Result   *[]TransactionalTemplatesTemplateLean `json:"result,omitempty"`
	Metadata *Metadata                             `json:"_metadata,omitempty"`
}

ListTemplate200Response struct for ListTemplate200Response

type ListTemplate400Response

type ListTemplate400Response struct {
	Errors *[]ListTemplate400ResponseErrorsInner `json:"errors,omitempty"`
}

ListTemplate400Response struct for ListTemplate400Response

type ListTemplate400ResponseErrorsInner

type ListTemplate400ResponseErrorsInner struct {
	Message *string `json:"message,omitempty"`
	ErrorId *string `json:"error_id,omitempty"`
}

ListTemplate400ResponseErrorsInner struct for ListTemplate400ResponseErrorsInner

type ListTemplateParam

type ListTemplateParam struct {
	// The number of templates to be returned in each page of results
	PageSize *float32 `json:"page_size"`
	// Comma-delimited list specifying which generations of templates to return. Options are `legacy`, `dynamic` or `legacy,dynamic`.
	Generations *Generations `json:"generations,omitempty"`
	// A token corresponding to a specific page of results, as provided by metadata
	PageToken *string `json:"page_token,omitempty"`
	// The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id <account-id>`). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: <subuser-username>`). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information.
	Onbehalfof *string `json:"on-behalf-of,omitempty"`
}

func (*ListTemplateParam) SetGenerations

func (params *ListTemplateParam) SetGenerations(Generations Generations) *ListTemplateParam

func (*ListTemplateParam) SetOnbehalfof

func (params *ListTemplateParam) SetOnbehalfof(Onbehalfof string) *ListTemplateParam

func (*ListTemplateParam) SetPageSize

func (params *ListTemplateParam) SetPageSize(PageSize float32) *ListTemplateParam

func (*ListTemplateParam) SetPageToken

func (params *ListTemplateParam) SetPageToken(PageToken string) *ListTemplateParam

type Metadata

type Metadata struct {
	Prev  *string `json:"prev,omitempty"`
	Self  *string `json:"self,omitempty"`
	Next  *string `json:"next,omitempty"`
	Count *int32  `json:"count,omitempty"`
}

Metadata struct for Metadata

type TransactionalTemplate

type TransactionalTemplate struct {
	// The ID of the transactional template.
	Id string `json:"id"`
	// The name for the transactional template.
	Name string `json:"name"`
	// Defines the generation of the template.
	Generation Generation1 `json:"generation"`
	// The date and time that this transactional template version was updated.
	UpdatedAt string `json:"updated_at"`
	// The different versions of this transactional template.
	Versions *[]TransactionalTemplatesVersionOutputLean `json:"versions,omitempty"`
	Warning  *TransactionalTemplateWarning              `json:"warning,omitempty"`
}

TransactionalTemplate struct for TransactionalTemplate

type TransactionalTemplateVersionCreate

type TransactionalTemplateVersionCreate struct {
	// Set the version as the active version associated with the template (0 is inactive, 1 is active). Only one version of a template can be active. The first version created for a template will automatically be set to Active.
	Active *Active `json:"active,omitempty"`
	// Name of the transactional template version.
	Name string `json:"name"`
	// The HTML content of the version. Maximum of 1048576 bytes allowed.
	HtmlContent *string `json:"html_content,omitempty"`
	// Text/plain content of the transactional template version. Maximum of 1048576 bytes allowed.
	PlainContent *string `json:"plain_content,omitempty"`
	// If true, plain_content is always generated from html_content. If false, plain_content is not altered.
	GeneratePlainContent *bool `json:"generate_plain_content,omitempty"`
	// Subject of the new transactional template version.
	Subject string `json:"subject"`
	// The editor used in the UI.
	Editor *Editor `json:"editor,omitempty"`
	// For dynamic templates only, the mock json data that will be used for template preview and test sends.
	TestData *string `json:"test_data,omitempty"`
}

TransactionalTemplateVersionCreate struct for TransactionalTemplateVersionCreate

type TransactionalTemplateVersionOutput

type TransactionalTemplateVersionOutput struct {
	Warnings *[]TransactionalTemplateWarning `json:"warnings,omitempty"`
	// Set the version as the active version associated with the template. Only one version of a template can be active. The first version created for a template will automatically be set to Active.
	Active *Active1 `json:"active,omitempty"`
	// Name of the transactional template version.
	Name string `json:"name"`
	// The HTML content of the Design.
	HtmlContent *string `json:"html_content,omitempty"`
	// Plain text content of the Design.
	PlainContent *string `json:"plain_content,omitempty"`
	// If true, plain_content is always generated from html_content. If false, plain_content is not altered.
	GeneratePlainContent *bool `json:"generate_plain_content,omitempty"`
	// Subject of the new transactional template version.
	Subject string `json:"subject"`
	// The editor used in the UI.
	Editor *Editor1 `json:"editor,omitempty"`
	// For dynamic templates only, the mock json data that will be used for template preview and test sends.
	TestData *string `json:"test_data,omitempty"`
	// ID of the transactional template version.
	Id *string `json:"id,omitempty"`
	// ID of the transactional template.
	TemplateId *string `json:"template_id,omitempty"`
	// The date and time that this transactional template version was updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
	// A Thumbnail preview of the template's html content.
	ThumbnailUrl *string `json:"thumbnail_url,omitempty"`
}

TransactionalTemplateVersionOutput struct for TransactionalTemplateVersionOutput

type TransactionalTemplateWarning

type TransactionalTemplateWarning struct {
	// Warning message for the user
	Message *string `json:"message,omitempty"`
}

TransactionalTemplateWarning struct for TransactionalTemplateWarning

type TransactionalTemplatesTemplateLean

type TransactionalTemplatesTemplateLean struct {
	// The ID of the transactional template.
	Id string `json:"id"`
	// The name for the transactional template.
	Name string `json:"name"`
	// Defines the generation of the template.
	Generation Generation1 `json:"generation"`
	// The date and time that this transactional template version was updated.
	UpdatedAt string `json:"updated_at"`
	// The different versions of this transactional template.
	Versions *[]TransactionalTemplatesVersionOutputLean `json:"versions,omitempty"`
}

TransactionalTemplatesTemplateLean struct for TransactionalTemplatesTemplateLean

type TransactionalTemplatesVersionOutputLean

type TransactionalTemplatesVersionOutputLean struct {
	// ID of the transactional template version.
	Id *string `json:"id,omitempty"`
	// ID of the transactional template.
	TemplateId *string `json:"template_id,omitempty"`
	// Set the version as the active version associated with the template. Only one version of a template can be active. The first version created for a template will automatically be set to Active.
	Active *Active1 `json:"active,omitempty"`
	// Name of the transactional template version.
	Name *string `json:"name,omitempty"`
	// Subject of the new transactional template version.
	Subject *string `json:"subject,omitempty"`
	// The date and time that this transactional template version was updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
	// If true, plain_content is always generated from html_content. If false, plain_content is not altered.
	GeneratePlainContent *bool `json:"generate_plain_content,omitempty"`
	// The HTML content of the Design.
	HtmlContent *string `json:"html_content,omitempty"`
	// Plain text content of the Design.
	PlainContent *string `json:"plain_content,omitempty"`
	// The editor used in the UI.
	Editor *Editor1 `json:"editor,omitempty"`
	// A Thumbnail preview of the template's html content.
	ThumbnailUrl *string `json:"thumbnail_url,omitempty"`
}

TransactionalTemplatesVersionOutputLean struct for TransactionalTemplatesVersionOutputLean

type UpdateTemplateParam

type UpdateTemplateParam struct {
	//
	TemplateId *string `json:"template_id"`
	// The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id <account-id>`). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: <subuser-username>`). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information.
	Onbehalfof *string `json:"on-behalf-of,omitempty"`
	//
	UpdateTemplateRequest *UpdateTemplateRequest `json:"UpdateTemplateRequest,omitempty"`
}

func (*UpdateTemplateParam) SetOnbehalfof

func (params *UpdateTemplateParam) SetOnbehalfof(Onbehalfof string) *UpdateTemplateParam

func (*UpdateTemplateParam) SetTemplateId

func (params *UpdateTemplateParam) SetTemplateId(TemplateId string) *UpdateTemplateParam

func (*UpdateTemplateParam) SetUpdateTemplateRequest

func (params *UpdateTemplateParam) SetUpdateTemplateRequest(UpdateTemplateRequest UpdateTemplateRequest) *UpdateTemplateParam

type UpdateTemplateRequest

type UpdateTemplateRequest struct {
	// The name of the transactional template.
	Name *string `json:"name,omitempty"`
}

UpdateTemplateRequest struct for UpdateTemplateRequest

type UpdateTemplateVersionParam

type UpdateTemplateVersionParam struct {
	//  The ID of the original template
	TemplateId *string `json:"template_id"`
	// The ID of the template version
	VersionId *string `json:"version_id"`
	// The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id <account-id>`). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: <subuser-username>`). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information.
	Onbehalfof *string `json:"on-behalf-of,omitempty"`
	//
	TransactionalTemplateVersionCreate *TransactionalTemplateVersionCreate `json:"TransactionalTemplateVersionCreate,omitempty"`
}

func (*UpdateTemplateVersionParam) SetOnbehalfof

func (params *UpdateTemplateVersionParam) SetOnbehalfof(Onbehalfof string) *UpdateTemplateVersionParam

func (*UpdateTemplateVersionParam) SetTemplateId

func (params *UpdateTemplateVersionParam) SetTemplateId(TemplateId string) *UpdateTemplateVersionParam

func (*UpdateTemplateVersionParam) SetTransactionalTemplateVersionCreate

func (params *UpdateTemplateVersionParam) SetTransactionalTemplateVersionCreate(TransactionalTemplateVersionCreate TransactionalTemplateVersionCreate) *UpdateTemplateVersionParam

func (*UpdateTemplateVersionParam) SetVersionId

func (params *UpdateTemplateVersionParam) SetVersionId(VersionId string) *UpdateTemplateVersionParam

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL