openapi

package
v4.0.0-rc.5 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: MIT Imports: 4 Imported by: 0

README

Go API client for

The Twilio SendGrid Enforced TLS API allows you to specify whether or not the recipient of your mail send is required to support TLS or have a valid certificate.

Twilio SendGrid sends all emails with Opportunistic TLS by default, meaning email is sent with TLS, and if the recipient's inbox provider does not accept the TLS encryption, we then send the message unencrypted.

You can optionally choose to enforce TLS encryption, meaning that if the recipient's inbox provider does not accept the TLS encryption, Twilio SendGrid drops the message and sends a block event with the message, “TLS required but not supported” as the description.

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: 2025-02-11T10:49:32.432615Z[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
ListEnforcedTlsSetting ListEnforcedTlsSetting Get /v3/user/settings/enforced_tls Retrieve current Enforced TLS settings.
UpdateEnforcedTlsSetting UpdateEnforcedTlsSetting Patch /v3/user/settings/enforced_tls Update Enforced TLS settings

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

func (c *ApiService) ListEnforcedTlsSetting(params *ListEnforcedTlsSettingParam) (interface{}, error)

**This endpoint allows you to retrieve your current Enforced TLS settings.** The Enforced TLS settings specify whether or not the recipient is required to support TLS or have a valid certificate. If either `require_tls` or `require_valid_cert` is set to `true`, the recipient must support TLS 1.1 or higher or have a valid certificate. If these conditions are not met, Twilio SendGrid will drop the message and send a block event with “TLS required but not supported” as the description.

func (*ApiService) UpdateEnforcedTlsSetting

func (c *ApiService) UpdateEnforcedTlsSetting(params *UpdateEnforcedTlsSettingParam) (interface{}, error)

**This endpoint allows you to update your Enforced TLS settings.** To require TLS from recipients, set `require_tls` to `true`. If either `require_tls` or `require_valid_cert` is set to `true`, the recipient must support TLS 1.1 or higher or have a valid certificate. If these conditions are not met, Twilio SendGrid will drop the message and send a block event with “TLS required but not supported” as the description.

type EnforcedTlsRequestResponse

type EnforcedTlsRequestResponse struct {
	// Indicates if you want to require your recipients to support TLS.
	RequireTls *bool `json:"require_tls,omitempty"`
	// Indicates if you want to require your recipients to have a valid certificate.
	RequireValidCert *bool `json:"require_valid_cert,omitempty"`
	// The minimum required TLS certificate version.
	Version *Version `json:"version,omitempty"`
}

EnforcedTlsRequestResponse struct for EnforcedTlsRequestResponse

type ErrorResponse

type ErrorResponse struct {
	Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"`
	// When applicable, this property value will be an error ID.
	Id *string `json:"id,omitempty"`
}

ErrorResponse struct for ErrorResponse

type ErrorResponseErrorsInner

type ErrorResponseErrorsInner struct {
	// An error message.
	Message *string `json:"message,omitempty"`
	// When applicable, this property value will be the field that generated the error.
	Field *string `json:"field,omitempty"`
	// When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error.
	Help *map[string]interface{} `json:"help,omitempty"`
}

ErrorResponseErrorsInner struct for ErrorResponseErrorsInner

type ListEnforcedTlsSettingParam

type ListEnforcedTlsSettingParam 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 (*ListEnforcedTlsSettingParam) SetOnbehalfof

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

type UpdateEnforcedTlsSettingParam

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

func (*UpdateEnforcedTlsSettingParam) SetEnforcedTlsRequestResponse

func (params *UpdateEnforcedTlsSettingParam) SetEnforcedTlsRequestResponse(EnforcedTlsRequestResponse EnforcedTlsRequestResponse) *UpdateEnforcedTlsSettingParam

func (*UpdateEnforcedTlsSettingParam) SetOnbehalfof

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

type Version

type Version float32

Version the model 'Version'

const (
	VERSION__1_DOT_1 Version = 1.1
	VERSION__1_DOT_2 Version = 1.2
	VERSION__1_DOT_3 Version = 1.3
)

List of Version

Jump to

Keyboard shortcuts

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