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 Legacy Marketing Campaigns Sender Identites API allows you to manage the email addresses used to send your marketing email. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your senders.

See Migrating from Legacy Marketing Campaigns for more information.

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:01.726433Z[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
CreateSender CreateSender Post /v3/senders Create a Sender Identity
DeleteSender DeleteSender Delete /v3/senders/{SenderId} Delete a Sender Identity
GetSender GetSender Get /v3/senders/{SenderId} View a Sender Identity
ListSender ListSender Get /v3/senders Get all Sender Identities
ResetSenderVerification ResetSenderVerification Post /v3/senders/{SenderId}/resend_verification Resend Sender Identity Verification
UpdateSender UpdateSender Patch /v3/senders/{SenderId} Update a Sender Identity

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 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) CreateSender

func (c *ApiService) CreateSender(params *CreateSenderParam) (interface{}, error)

**This endpoint allows you to create a new sender identity.** You may create up to 100 unique sender identities.

func (*ApiService) DeleteSender

func (c *ApiService) DeleteSender(params *DeleteSenderParam) (interface{}, error)

**This endpoint allows you to delete one of your sender identities.**

func (*ApiService) GetSender

func (c *ApiService) GetSender(params *GetSenderParam) (interface{}, error)

**This endpoint allows you to retrieve a specific sender identity.**

func (*ApiService) ListSender

func (c *ApiService) ListSender(params *ListSenderParam) (interface{}, error)

**This endpoint allows you to retrieve a list of all sender identities that have been created for your account.**

func (*ApiService) ResetSenderVerification

func (c *ApiService) ResetSenderVerification(params *ResetSenderVerificationParam) (interface{}, error)

**This endpoint allows you to resend a sender identity verification email.**

func (*ApiService) UpdateSender

func (c *ApiService) UpdateSender(params *UpdateSenderParam) (interface{}, error)

**This endpoint allows you to update a sender identity.** Updates to `from.email` require re-verification. Partial updates are allowed, but fields that are marked as \"required\" in the POST (create) endpoint must not be nil if that field is included in the PATCH request.

type CreateSender400Response

type CreateSender400Response struct {
	Errors *[]CreateSender400ResponseErrorsInner `json:"errors,omitempty"`
}

CreateSender400Response struct for CreateSender400Response

type CreateSender400ResponseErrorsInner

type CreateSender400ResponseErrorsInner struct {
	Message *string `json:"message,omitempty"`
	Field   *string `json:"field,omitempty"`
}

CreateSender400ResponseErrorsInner struct for CreateSender400ResponseErrorsInner

type CreateSenderParam

type CreateSenderParam 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"`
	//
	CreateSenderRequest *CreateSenderRequest `json:"CreateSenderRequest,omitempty"`
}

func (*CreateSenderParam) SetCreateSenderRequest

func (params *CreateSenderParam) SetCreateSenderRequest(CreateSenderRequest CreateSenderRequest) *CreateSenderParam

func (*CreateSenderParam) SetOnbehalfof

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

type CreateSenderRequest

type CreateSenderRequest struct {
	// A nickname for the sender identity. Not used for sending.
	Nickname string                  `json:"nickname"`
	From     *map[string]interface{} `json:"from,omitempty"`
	ReplyTo  *map[string]interface{} `json:"reply_to,omitempty"`
	// The physical address of the sender identity.
	Address string `json:"address"`
	// Additional sender identity address information.
	Address2 *string `json:"address_2,omitempty"`
	// The city of the sender identity.
	City string `json:"city"`
	// The state of the sender identity.
	State *string `json:"state,omitempty"`
	// The zipcode of the sender identity.
	Zip *string `json:"zip,omitempty"`
	// The country of the sender identity.
	Country string `json:"country"`
}

CreateSenderRequest struct for CreateSenderRequest

type DeleteSenderParam

type DeleteSenderParam struct {
	// The ID of the sender identity that you want to retrieve.
	SenderId *int32 `json:"sender_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 (*DeleteSenderParam) SetOnbehalfof

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

func (*DeleteSenderParam) SetSenderId

func (params *DeleteSenderParam) SetSenderId(SenderId int32) *DeleteSenderParam

type GetSenderParam

type GetSenderParam struct {
	// The ID of the sender identity that you want to retrieve.
	SenderId *int32 `json:"sender_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 (*GetSenderParam) SetOnbehalfof

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

func (*GetSenderParam) SetSenderId

func (params *GetSenderParam) SetSenderId(SenderId int32) *GetSenderParam

type ListSender200Response

type ListSender200Response struct {
	Result *[]SenderId `json:"result,omitempty"`
}

ListSender200Response struct for ListSender200Response

type ListSenderParam

type ListSenderParam 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"`
}

func (*ListSenderParam) SetOnbehalfof

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

type ResetSenderVerificationParam

type ResetSenderVerificationParam struct {
	// The ID of the sender identity for which you would like to resend a verification email.
	SenderId *int32 `json:"sender_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 (*ResetSenderVerificationParam) SetOnbehalfof

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

func (*ResetSenderVerificationParam) SetSenderId

func (params *ResetSenderVerificationParam) SetSenderId(SenderId int32) *ResetSenderVerificationParam

type SenderId

type SenderId struct {
	// A nickname for the sender identity. Not used for sending.
	Nickname string                  `json:"nickname"`
	From     *SenderIdRequestFrom    `json:"from,omitempty"`
	ReplyTo  *SenderIdRequestReplyTo `json:"reply_to,omitempty"`
	// The physical address of the sender identity.
	Address string `json:"address"`
	// Additional sender identity address information.
	Address2 *string `json:"address_2,omitempty"`
	// The city of the sender identity.
	City string `json:"city"`
	// The state of the sender identity.
	State *string `json:"state,omitempty"`
	// The zipcode of the sender identity.
	Zip *string `json:"zip,omitempty"`
	// The country of the sender identity.
	Country string `json:"country"`
	// The unique identifier of the sender identity.
	Id *int32 `json:"id,omitempty"`
	// If the sender identity is verified or not. Only verified sender identities can be used to send email.
	Verified *bool `json:"verified,omitempty"`
	// The time the sender identity was last updated.
	UpdatedAt *int32 `json:"updated_at,omitempty"`
	// The time the sender identity was created.
	CreatedAt *int32 `json:"created_at,omitempty"`
	// True when the sender id is associated to a campaign in the Draft, Scheduled, or In Progress status. You cannot update or delete a locked sender identity.
	Locked *bool `json:"locked,omitempty"`
}

SenderId struct for SenderId

type SenderIdRequest

type SenderIdRequest struct {
	// A nickname for the sender identity. Not used for sending.
	Nickname *string                 `json:"nickname,omitempty"`
	From     *SenderIdRequestFrom    `json:"from,omitempty"`
	ReplyTo  *SenderIdRequestReplyTo `json:"reply_to,omitempty"`
	// The physical address of the sender identity.
	Address *string `json:"address,omitempty"`
	// Additional sender identity address information.
	Address2 *string `json:"address_2,omitempty"`
	// The city of the sender identity.
	City *string `json:"city,omitempty"`
	// The state of the sender identity.
	State *string `json:"state,omitempty"`
	// The zipcode of the sender identity.
	Zip *string `json:"zip,omitempty"`
	// The country of the sender identity.
	Country *string `json:"country,omitempty"`
}

SenderIdRequest struct for SenderIdRequest

type SenderIdRequestFrom

type SenderIdRequestFrom struct {
	// The email address from which your recipient will receive emails.
	Email *string `json:"email,omitempty"`
	// The name appended to the from email field. Typically your name or company name.
	Name *string `json:"name,omitempty"`
}

SenderIdRequestFrom struct for SenderIdRequestFrom

type SenderIdRequestReplyTo

type SenderIdRequestReplyTo struct {
	// The email address to which your recipient will reply.
	Email *string `json:"email,omitempty"`
	// The name appended to the reply to email field. Typically your name or company name.
	Name *string `json:"name,omitempty"`
}

SenderIdRequestReplyTo struct for SenderIdRequestReplyTo

type UpdateSenderParam

type UpdateSenderParam struct {
	// The ID of the sender identity that you want to retrieve.
	SenderId *int32 `json:"sender_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"`
	//
	SenderIdRequest *SenderIdRequest `json:"SenderIdRequest,omitempty"`
}

func (*UpdateSenderParam) SetOnbehalfof

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

func (*UpdateSenderParam) SetSenderId

func (params *UpdateSenderParam) SetSenderId(SenderId int32) *UpdateSenderParam

func (*UpdateSenderParam) SetSenderIdRequest

func (params *UpdateSenderParam) SetSenderIdRequest(SenderIdRequest SenderIdRequest) *UpdateSenderParam

Jump to

Keyboard shortcuts

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