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: 5 Imported by: 0

README

Go API client for

Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to Segment. You can use this API to create, delete, view, and update your Integrations.

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.758803Z[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
AddIntegration AddIntegration Post /v3/marketing/integrations CreateIntegration
DeleteIntegration DeleteIntegration Delete /v3/marketing/integrations DeleteBulkIntegration
FindIntegrationById FindIntegrationById Get /v3/marketing/integrations/{Id} GetIntegration
GetIntegrationsByUser GetIntegrationsByUser Get /v3/marketing/integrations ListIntegration
UpdateIntegration UpdateIntegration Patch /v3/marketing/integrations/{Id} UpdateIntegration

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 AddIntegration400Response

type AddIntegration400Response struct {
	Errors *[]InvalidRequest `json:"errors,omitempty"`
}

AddIntegration400Response struct for AddIntegration400Response

type AddIntegrationParam

type AddIntegrationParam struct {
	//
	IntegrationInput *IntegrationInput `json:"IntegrationInput"`
}

func (*AddIntegrationParam) SetIntegrationInput

func (params *AddIntegrationParam) SetIntegrationInput(IntegrationInput IntegrationInput) *AddIntegrationParam

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

func (c *ApiService) AddIntegration(params *AddIntegrationParam) (interface{}, error)

This endpoint creates an Integration for email event forwarding. Each Integration has a maximum number of allowed Integration instances per user. For example, users can create up to 10 Segment Integrations.

func (*ApiService) DeleteIntegration

func (c *ApiService) DeleteIntegration(params *DeleteIntegrationParam) (interface{}, error)

This endpoint deletes Integrations.

func (*ApiService) FindIntegrationById

func (c *ApiService) FindIntegrationById(params *FindIntegrationByIdParam) (interface{}, error)

This endpoint returns the data for a specific Integration.

func (*ApiService) GetIntegrationsByUser

func (c *ApiService) GetIntegrationsByUser() (interface{}, error)

This endpoint returns all the Integrations for the user making this call.

func (*ApiService) UpdateIntegration

func (c *ApiService) UpdateIntegration(params *UpdateIntegrationParam) (interface{}, error)

This endpoint updates an existing Integration.

type DeleteIntegration400Response

type DeleteIntegration400Response struct {
	Errors *[]InvalidDeleteRequest `json:"errors,omitempty"`
}

DeleteIntegration400Response struct for DeleteIntegration400Response

type DeleteIntegration404Response

type DeleteIntegration404Response struct {
	Errors *[]IntegrationNotFound `json:"errors,omitempty"`
}

DeleteIntegration404Response struct for DeleteIntegration404Response

type DeleteIntegrationParam

type DeleteIntegrationParam struct {
	// Comma-delimited Integration IDs for the Integrations to delete.
	Ids *[]Id `json:"ids"`
}

func (*DeleteIntegrationParam) SetIds

func (params *DeleteIntegrationParam) SetIds(Ids []Id) *DeleteIntegrationParam

type Destination

type Destination string

Destination The third-party application you would like to forward your email events to.

const (
	DESTINATION_SEGMENT Destination = "Segment"
)

List of Destination

type Destination1

type Destination1 string

Destination1 the model 'Destination1'

const (
	DESTINATION1_SEGMENT Destination1 = "Segment"
)

List of Destination1

type Destination2

type Destination2 string

Destination2 the model 'Destination2'

const (
	DESTINATION2_SEGMENT Destination2 = "Segment"
)

List of Destination2

type Destination3

type Destination3 string

Destination3 the model 'Destination3'

const (
	DESTINATION3_SEGMENT Destination3 = "Segment"
)

List of Destination3

type DestinationRegion

type DestinationRegion string

DestinationRegion the model 'DestinationRegion'

const (
	DESTINATIONREGION_EU DestinationRegion = "EU"
	DESTINATIONREGION_US DestinationRegion = "US"
)

List of DestinationRegion

type DestinationRegion1

type DestinationRegion1 string

DestinationRegion1 the model 'DestinationRegion1'

const (
	DESTINATIONREGION1_EU DestinationRegion1 = "EU"
	DESTINATIONREGION1_US DestinationRegion1 = "US"
)

List of DestinationRegion1

type DestinationRegion2

type DestinationRegion2 string

DestinationRegion2 the model 'DestinationRegion2'

const (
	DESTINATIONREGION2_EU DestinationRegion2 = "EU"
	DESTINATIONREGION2_US DestinationRegion2 = "US"
)

List of DestinationRegion2

type FindIntegrationByIdParam

type FindIntegrationByIdParam struct {
	// The ID of the Integration you would like to retrieve.
	Id *string `json:"id"`
}

func (*FindIntegrationByIdParam) SetId

type Forbidden

type Forbidden struct {
	// The error message tells you the cause of failure.
	Message *string `json:"message,omitempty"`
}

Forbidden struct for Forbidden

type GetIntegrationsByUser200Response

type GetIntegrationsByUser200Response struct {
	Result *[]Integration `json:"result,omitempty"`
}

GetIntegrationsByUser200Response struct for GetIntegrationsByUser200Response

type GetIntegrationsByUser403Response

type GetIntegrationsByUser403Response struct {
	Errors *[]Forbidden `json:"errors,omitempty"`
}

GetIntegrationsByUser403Response struct for GetIntegrationsByUser403Response

type GetIntegrationsByUser500Response

type GetIntegrationsByUser500Response struct {
	Errors *[]InternalError `json:"errors,omitempty"`
}

GetIntegrationsByUser500Response struct for GetIntegrationsByUser500Response

type GetIntegrationsByUserParam

type GetIntegrationsByUserParam struct {
}

type Id

type Id struct {
	IntegrationId *string `json:"integration_id,omitempty"`
}

Id The unique ID of an Integration.

type Integration

type Integration struct {
	// The unique ID of an Integration.
	IntegrationId *string `json:"integration_id,omitempty"`
	// Your Twilio SendGrid account ID.
	UserId     *string                `json:"user_id,omitempty"`
	Filters    *IntegrationFilters    `json:"filters,omitempty"`
	Properties *IntegrationProperties `json:"properties,omitempty"`
	// The nickname for the Integration.
	Label *string `json:"label,omitempty"`
	// The third-party application you would like to forward your events to.
	Destination *Destination3 `json:"destination,omitempty"`
}

Integration struct for Integration

type IntegrationFilters

type IntegrationFilters struct {
	// The possible SendGrid email event types for event forwarding. Specify all the email event types that you would like to forward to the Integration's destination.
	EmailEvents *[]Items2 `json:"email_events,omitempty"`
}

IntegrationFilters The configurable filters for SendGrid to destination email event forwarding.

type IntegrationInput

type IntegrationInput struct {
	// The third-party application you would like to forward your events to.
	Destination Destination2               `json:"destination"`
	Filters     IntegrationInputFilters    `json:"filters"`
	Properties  IntegrationInputProperties `json:"properties"`
	// The nickname for the Integration.
	Label *string `json:"label,omitempty"`
}

IntegrationInput struct for IntegrationInput

type IntegrationInputFilters

type IntegrationInputFilters struct {
	// The possible SendGrid email event types for event forwarding. Specify all the email event types that you would like to forward to the Integration's destination.
	EmailEvents []Items1 `json:"email_events"`
}

IntegrationInputFilters The configurable filters for SendGrid to destination email event forwarding.

type IntegrationInputProperties

type IntegrationInputProperties struct {
	// The write key provided by the Segment Source you'd like to have events forwarded to. Must be between 6 and 51 characters.
	WriteKey string `json:"write_key"`
	// The workspace region where the Segment Source write key lives.
	DestinationRegion DestinationRegion1 `json:"destination_region"`
}

IntegrationInputProperties The properties of an Integration required to send events to a specific third-party application.

type IntegrationNotFound

type IntegrationNotFound struct {
	// The error message tells you the cause of failure.
	Message *string `json:"message,omitempty"`
}

IntegrationNotFound struct for IntegrationNotFound

type IntegrationPatch

type IntegrationPatch struct {
	// The third-party application you would like to forward your email events to.
	Destination *Destination1               `json:"destination,omitempty"`
	Filters     *IntegrationPatchFilters    `json:"filters,omitempty"`
	Properties  *IntegrationPatchProperties `json:"properties,omitempty"`
	// The nickname for the Integration.
	Label *string `json:"label,omitempty"`
}

IntegrationPatch struct for IntegrationPatch

type IntegrationPatchFilters

type IntegrationPatchFilters struct {
	// The possible SendGrid email event types for event forwarding. Specify all the email event types that you would like to forward to the Integration's destination.
	EmailEvents *[]Items `json:"email_events,omitempty"`
}

IntegrationPatchFilters The configurable filters for SendGrid to destination email event forwarding.

type IntegrationPatchProperties

type IntegrationPatchProperties struct {
	// The write key provided by the Segment Source you'd like to have events forwarded to. Must be between 6 and 51 characters.
	WriteKey *string `json:"write_key,omitempty"`
	// The workspace region where the Segment Source write key lives.
	DestinationRegion *DestinationRegion `json:"destination_region,omitempty"`
}

IntegrationPatchProperties The properties of an Integration required to send events to a specific third-party application.

type IntegrationProperties

type IntegrationProperties struct {
	// The write key provided by the Segment Source you'd like to have events forwarded to. Must be between 6 and 51 characters.
	WriteKey *string `json:"write_key,omitempty"`
	// The workspace region where the Segment Source write key lives.
	DestinationRegion *DestinationRegion2 `json:"destination_region,omitempty"`
}

IntegrationProperties The properties of an Integration required to send events to a specific third-party application.

type InternalError

type InternalError struct {
	// The error message tells you the cause of failure.
	Message *string `json:"message,omitempty"`
}

InternalError struct for InternalError

type InvalidDeleteRequest

type InvalidDeleteRequest struct {
	// The error message tells you the cause of failure.
	Message *string `json:"message,omitempty"`
	// The parameter shows more information about where the error is. The number in the brackets is the invalid ID indexed.
	Parameter *string `json:"parameter,omitempty"`
}

InvalidDeleteRequest struct for InvalidDeleteRequest

type InvalidRequest

type InvalidRequest struct {
	// The error message tells you the cause of validation failure(s), separated by commas if there are multiple failures.
	Message *string `json:"message,omitempty"`
	// The field shows more information on where the error is when available.
	Field *string `json:"field,omitempty"`
}

InvalidRequest struct for InvalidRequest

type Items

type Items string

Items the model 'Items'

const (
	ITEMS_DROP              Items = "drop"
	ITEMS_PROCESSED         Items = "processed"
	ITEMS_DEFERRED          Items = "deferred"
	ITEMS_GROUP_UNSUBSCRIBE Items = "group_unsubscribe"
	ITEMS_BOUNCE            Items = "bounce"
	ITEMS_DELIVERED         Items = "delivered"
	ITEMS_CLICK             Items = "click"
	ITEMS_UNSUBSCRIBE       Items = "unsubscribe"
	ITEMS_OPEN              Items = "open"
	ITEMS_GROUP_RESUBSCRIBE Items = "group_resubscribe"
	ITEMS_SPAMREPORT        Items = "spamreport"
	ITEMS_MACHINE_OPENED    Items = "machine_opened"
)

List of Items

type Items1

type Items1 string

Items1 the model 'Items1'

const (
	ITEMS1_DROP              Items1 = "drop"
	ITEMS1_PROCESSED         Items1 = "processed"
	ITEMS1_DEFERRED          Items1 = "deferred"
	ITEMS1_GROUP_UNSUBSCRIBE Items1 = "group_unsubscribe"
	ITEMS1_BOUNCE            Items1 = "bounce"
	ITEMS1_DELIVERED         Items1 = "delivered"
	ITEMS1_CLICK             Items1 = "click"
	ITEMS1_UNSUBSCRIBE       Items1 = "unsubscribe"
	ITEMS1_OPEN              Items1 = "open"
	ITEMS1_GROUP_RESUBSCRIBE Items1 = "group_resubscribe"
	ITEMS1_SPAMREPORT        Items1 = "spamreport"
	ITEMS1_MACHINE_OPENED    Items1 = "machine_opened"
)

List of Items1

type Items2

type Items2 string

Items2 the model 'Items2'

const (
	ITEMS2_DROP              Items2 = "drop"
	ITEMS2_PROCESSED         Items2 = "processed"
	ITEMS2_DEFERRED          Items2 = "deferred"
	ITEMS2_GROUP_UNSUBSCRIBE Items2 = "group_unsubscribe"
	ITEMS2_BOUNCE            Items2 = "bounce"
	ITEMS2_DELIVERED         Items2 = "delivered"
	ITEMS2_CLICK             Items2 = "click"
	ITEMS2_UNSUBSCRIBE       Items2 = "unsubscribe"
	ITEMS2_OPEN              Items2 = "open"
	ITEMS2_GROUP_RESUBSCRIBE Items2 = "group_resubscribe"
	ITEMS2_SPAMREPORT        Items2 = "spamreport"
	ITEMS2_MACHINE_OPENED    Items2 = "machine_opened"
)

List of Items2

type UpdateIntegrationParam

type UpdateIntegrationParam struct {
	// The ID of the Integration you would like to update.
	Id *string `json:"id"`
	//
	IntegrationPatch *IntegrationPatch `json:"IntegrationPatch"`
}

func (*UpdateIntegrationParam) SetId

func (*UpdateIntegrationParam) SetIntegrationPatch

func (params *UpdateIntegrationParam) SetIntegrationPatch(IntegrationPatch IntegrationPatch) *UpdateIntegrationParam

Jump to

Keyboard shortcuts

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