Documentation ¶
Index ¶
- type ApiError
- type ApiErrors
- type ApiService
- func (c *ApiService) CreateDesign(params *CreateDesignParam) (interface{}, error)
- func (c *ApiService) DeleteDesign(params *DeleteDesignParam) (interface{}, error)
- func (c *ApiService) DuplicateDesign(params *DuplicateDesignParam) (interface{}, error)
- func (c *ApiService) DuplicatePreBuiltDesign(params *DuplicatePreBuiltDesignParam) (interface{}, error)
- func (c *ApiService) GetDesign(params *GetDesignParam) (interface{}, error)
- func (c *ApiService) GetPreBuiltDesign(params *GetPreBuiltDesignParam) (interface{}, error)
- func (c *ApiService) ListDesign(params *ListDesignParam) (interface{}, error)
- func (c *ApiService) ListPreBuiltDesign(params *ListPreBuiltDesignParam) (interface{}, error)
- func (c *ApiService) UpdateDesign(params *UpdateDesignParam) (interface{}, error)
- type CreateDesignParam
- type DeleteDesignParam
- type DesignCommonProperties
- type DesignDuplicateInput
- type DesignInput
- type DesignOutput
- type DesignOutputSummary
- type DuplicateDesignParam
- type DuplicatePreBuiltDesignParam
- type Editor
- type GetDesignParam
- type GetPreBuiltDesignParam
- type ListDesign200Response
- type ListDesignParam
- type ListPreBuiltDesignParam
- type Metadata
- type UpdateDesignParam
- type UpdateDesignRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiError ¶
type ApiError struct { Message string `json:"message"` Field string `json:"field"` ErrorId string `json:"error_id"` }
ApiError struct for ApiError
type ApiErrors ¶
type ApiErrors struct {
Errors *[]ApiError `json:"errors,omitempty"`
}
ApiErrors struct for ApiErrors
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) CreateDesign ¶
func (c *ApiService) CreateDesign(params *CreateDesignParam) (interface{}, error)
**This endpoint allows you to create a new design**. You can add a new design by passing data, including a string of HTML email content, to `/designs`. When creating designs from scratch, be aware of the styling constraints inherent to many email clients. For a list of best practices, see our guide to [Cross-Platform Email Design](https://sendgrid.com/docs/ui/sending-email/cross-platform-html-design/). The Design Library can also convert your design’s HTML elements into drag and drop modules that are editable in the Designs Library user interface. For more, visit the [Design and Code Editor documentation](https://sendgrid.com/docs/ui/sending-email/editor/#drag--drop-markup). Because the `/designs` endpoint makes it easy to add designs, you can create a design with your preferred tooling or migrate designs you already own without relying on the Design Library UI.
func (*ApiService) DeleteDesign ¶
func (c *ApiService) DeleteDesign(params *DeleteDesignParam) (interface{}, error)
**This endpoint allows you to delete a single design**. Be sure to check the ID of the design you intend to delete before making this request; deleting a design is a permanent action.
func (*ApiService) DuplicateDesign ¶
func (c *ApiService) DuplicateDesign(params *DuplicateDesignParam) (interface{}, error)
**This endpoint allows you to duplicate one of your existing designs**. Modifying an existing design is often the easiest way to create something new. You are not required to pass any data in the body of a request to this endpoint. If you choose to leave the `name` field blank, your duplicate will be assigned the name of the design it was copied from with the text \"Duplicate: \" prepended to it. This name change is only a convenience, as the duplicate will be assigned a unique ID that differentiates it from your other designs. You can modify your duplicate’s name at the time of creation by passing an updated value to the `name` field when making the initial request. More on retrieving design IDs can be found below.
func (*ApiService) DuplicatePreBuiltDesign ¶
func (c *ApiService) DuplicatePreBuiltDesign(params *DuplicatePreBuiltDesignParam) (interface{}, error)
**This endpoint allows you to duplicate one of the pre-built Twilio SendGrid designs**. Like duplicating one of your existing designs, you are not required to pass any data in the body of a request to this endpoint. If you choose to leave the `name` field blank, your duplicate will be assigned the name of the design it was copied from with the text \"Duplicate: \" prepended to it. This name change is only a convenience, as the duplicate design will be assigned a unique ID that differentiates it from your other designs. You can retrieve the IDs for Twilio SendGrid pre-built designs using the \"List SendGrid Pre-built Designs\" endpoint. You can modify your duplicate’s name at the time of creation by passing an updated value to the `name` field when making the initial request. More on retrieving design IDs can be found above.
func (*ApiService) GetDesign ¶
func (c *ApiService) GetDesign(params *GetDesignParam) (interface{}, error)
**This endpoint allows you to retrieve a single design**. A GET request to `/designs/{id}` will retrieve details about a specific design in your Design Library. This endpoint is valuable when retrieving information stored in a field that you wish to update using a PATCH request.
func (*ApiService) GetPreBuiltDesign ¶
func (c *ApiService) GetPreBuiltDesign(params *GetPreBuiltDesignParam) (interface{}, error)
**This endpoint allows you to retrieve a single pre-built design**. A GET request to `/designs/pre-builts/{id}` will retrieve details about a specific pre-built design. This endpoint is valuable when retrieving details about a pre-built design that you wish to duplicate and modify.
func (*ApiService) ListDesign ¶
func (c *ApiService) ListDesign(params *ListDesignParam) (interface{}, error)
**This endpoint allows you to retrieve a list of designs already stored in your Design Library**. A GET request to `/designs` will return a list of your existing designs. This endpoint will not return the pre-built Twilio SendGrid designs. Pre-built designs can be retrieved using the `/designs/pre-builts` endpoint, which is detailed below. By default, you will receive 100 results per request; however, you can modify the number of results returned by passing an integer to the `page_size` query parameter.
func (*ApiService) ListPreBuiltDesign ¶
func (c *ApiService) ListPreBuiltDesign(params *ListPreBuiltDesignParam) (interface{}, error)
**This endpoint allows you to retrieve a list of pre-built designs provided by Twilio SendGrid**. Unlike the `/designs` endpoint where *your* designs are stored, a GET request made to `designs/pre-builts` will retrieve a list of the pre-built Twilio SendGrid designs. This endpoint will not return the designs stored in your Design Library. By default, you will receive 100 results per request; however, you can modify the number of results returned by passing an integer to the `page_size` query parameter. This endpoint is useful for retrieving the IDs of Twilio SendGrid designs that you want to duplicate and modify.
func (*ApiService) UpdateDesign ¶
func (c *ApiService) UpdateDesign(params *UpdateDesignParam) (interface{}, error)
**This endpoint allows you to edit a design**. The Design API supports PATCH requests, which allow you to make partial updates to a single design. Passing data to a specific field will update only the data stored in that field; all other fields will be unaltered. For example, updating a design's name requires that you make a PATCH request to this endpoint with data specified for the `name` field only. ``` { \"name\": \"<Updated Name>\" } ```
type CreateDesignParam ¶
type CreateDesignParam struct { // DesignInput *DesignInput `json:"DesignInput,omitempty"` }
func (*CreateDesignParam) SetDesignInput ¶
func (params *CreateDesignParam) SetDesignInput(DesignInput DesignInput) *CreateDesignParam
type DeleteDesignParam ¶
type DeleteDesignParam struct { // The ID of the Design you want to duplicate. Id *string `json:"id"` }
func (*DeleteDesignParam) SetId ¶
func (params *DeleteDesignParam) SetId(Id string) *DeleteDesignParam
type DesignCommonProperties ¶
type DesignCommonProperties struct { // The name of the new design. Name *string `json:"name,omitempty"` // The editor used in the UI. Editor *Editor `json:"editor,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 Design. Subject *string `json:"subject,omitempty"` // The list of categories applied to the design Categories *[]string `json:"categories,omitempty"` }
DesignCommonProperties struct for DesignCommonProperties
type DesignDuplicateInput ¶
type DesignDuplicateInput struct { // The name of the new design. Name *string `json:"name,omitempty"` // The editor used in the UI. Editor *Editor `json:"editor,omitempty"` }
DesignDuplicateInput struct for DesignDuplicateInput
type DesignInput ¶
type DesignInput struct { // The name of the new design. Name *string `json:"name,omitempty"` // The editor used in the UI. Editor *Editor `json:"editor,omitempty"` // The HTML content of the Design. HtmlContent string `json:"html_content"` // Plain text content of the Design. PlainContent *string `json:"plain_content,omitempty"` }
DesignInput struct for DesignInput
type DesignOutput ¶
type DesignOutput struct { // The name of the new design. Name *string `json:"name,omitempty"` // The editor used in the UI. Editor *Editor `json:"editor,omitempty"` // The HTML content of the Design. HtmlContent string `json:"html_content"` // Plain text content of the Design. PlainContent *string `json:"plain_content,omitempty"` }
DesignOutput struct for DesignOutput
type DesignOutputSummary ¶
type DesignOutputSummary struct { // ID of the Design. Id *string `json:"id,omitempty"` // Datetime that Design was last updated. UpdatedAt *string `json:"updated_at,omitempty"` // Datetime that Design was created. CreatedAt *string `json:"created_at,omitempty"` // A Thumbnail preview of the template's html content. ThumbnailUrl *string `json:"thumbnail_url,omitempty"` // The name of the new design. Name *string `json:"name,omitempty"` // The editor used in the UI. Editor *Editor `json:"editor,omitempty"` }
DesignOutputSummary struct for DesignOutputSummary
type DuplicateDesignParam ¶
type DuplicateDesignParam struct { // The ID of the Design you want to duplicate. Id *string `json:"id"` // DesignDuplicateInput *DesignDuplicateInput `json:"DesignDuplicateInput,omitempty"` }
func (*DuplicateDesignParam) SetDesignDuplicateInput ¶
func (params *DuplicateDesignParam) SetDesignDuplicateInput(DesignDuplicateInput DesignDuplicateInput) *DuplicateDesignParam
func (*DuplicateDesignParam) SetId ¶
func (params *DuplicateDesignParam) SetId(Id string) *DuplicateDesignParam
type DuplicatePreBuiltDesignParam ¶
type DuplicatePreBuiltDesignParam struct { // The ID of the pre-built Design you want to duplicate. Id *string `json:"id"` // DesignDuplicateInput *DesignDuplicateInput `json:"DesignDuplicateInput,omitempty"` }
func (*DuplicatePreBuiltDesignParam) SetDesignDuplicateInput ¶
func (params *DuplicatePreBuiltDesignParam) SetDesignDuplicateInput(DesignDuplicateInput DesignDuplicateInput) *DuplicatePreBuiltDesignParam
func (*DuplicatePreBuiltDesignParam) SetId ¶
func (params *DuplicatePreBuiltDesignParam) SetId(Id string) *DuplicatePreBuiltDesignParam
type GetDesignParam ¶
type GetDesignParam struct { // The ID of the Design you want to duplicate. Id *string `json:"id"` }
func (*GetDesignParam) SetId ¶
func (params *GetDesignParam) SetId(Id string) *GetDesignParam
type GetPreBuiltDesignParam ¶
type GetPreBuiltDesignParam struct { // The ID of the pre-built Design you want to duplicate. Id *string `json:"id"` }
func (*GetPreBuiltDesignParam) SetId ¶
func (params *GetPreBuiltDesignParam) SetId(Id string) *GetPreBuiltDesignParam
type ListDesign200Response ¶
type ListDesign200Response struct { Result *[]DesignOutputSummary `json:"result,omitempty"` Metadata *Metadata `json:"_metadata,omitempty"` }
ListDesign200Response struct for ListDesign200Response
type ListDesignParam ¶
type ListDesignParam struct { // number of results to return PageSize *int32 `json:"page_size,omitempty"` // token corresponding to a specific page of results, as provided by metadata PageToken *string `json:"page_token,omitempty"` // set to false to return all fields Summary *bool `json:"summary,omitempty"` }
func (*ListDesignParam) SetPageSize ¶
func (params *ListDesignParam) SetPageSize(PageSize int32) *ListDesignParam
func (*ListDesignParam) SetPageToken ¶
func (params *ListDesignParam) SetPageToken(PageToken string) *ListDesignParam
func (*ListDesignParam) SetSummary ¶
func (params *ListDesignParam) SetSummary(Summary bool) *ListDesignParam
type ListPreBuiltDesignParam ¶
type ListPreBuiltDesignParam struct { // number of results to return PageSize *int32 `json:"page_size,omitempty"` // token corresponding to a specific page of results, as provided by metadata PageToken *string `json:"page_token,omitempty"` // set to false to return all fields Summary *bool `json:"summary,omitempty"` }
func (*ListPreBuiltDesignParam) SetPageSize ¶
func (params *ListPreBuiltDesignParam) SetPageSize(PageSize int32) *ListPreBuiltDesignParam
func (*ListPreBuiltDesignParam) SetPageToken ¶
func (params *ListPreBuiltDesignParam) SetPageToken(PageToken string) *ListPreBuiltDesignParam
func (*ListPreBuiltDesignParam) SetSummary ¶
func (params *ListPreBuiltDesignParam) SetSummary(Summary bool) *ListPreBuiltDesignParam
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 UpdateDesignParam ¶
type UpdateDesignParam struct { // The ID of the Design you want to duplicate. Id *string `json:"id"` // UpdateDesignRequest *UpdateDesignRequest `json:"UpdateDesignRequest,omitempty"` }
func (*UpdateDesignParam) SetId ¶
func (params *UpdateDesignParam) SetId(Id string) *UpdateDesignParam
func (*UpdateDesignParam) SetUpdateDesignRequest ¶
func (params *UpdateDesignParam) SetUpdateDesignRequest(UpdateDesignRequest UpdateDesignRequest) *UpdateDesignParam
type UpdateDesignRequest ¶
type UpdateDesignRequest struct { // Name of the Design. Name *string `json:"name,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"` // 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 Design. Subject *string `json:"subject,omitempty"` // The list of categories applied to the design Categories *[]string `json:"categories,omitempty"` }
UpdateDesignRequest struct for UpdateDesignRequest
Source Files ¶
- api_create_design.go
- api_delete_design.go
- api_duplicate_design.go
- api_duplicate_pre_built_design.go
- api_get_design.go
- api_get_pre_built_design.go
- api_list_design.go
- api_list_pre_built_design.go
- api_service.go
- api_update_design.go
- model_api_error.go
- model_api_errors.go
- model_design_common_properties.go
- model_design_duplicate_input.go
- model_design_input.go
- model_design_output.go
- model_design_output_summary.go
- model_editor.go
- model_list_design_200_response.go
- model_metadata.go
- model_update_design_request.go