salesforce

package
v0.0.0-...-9c704d3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package salesforce This file has bulk related functionality that is internal to this package.

Index

Constants

View Source
const (
	UpsertMode BulkOperationMode = "upsert"
	DeleteMode BulkOperationMode = "delete"

	JobStateAborted        = "Aborted"
	JobStateFailed         = "Failed"
	JobStateComplete       = "JobComplete"
	JobStateInProgress     = "InProgress"
	JobStateUploadComplete = "UploadComplete"
)
View Source
const OAuthIntrospectResource = "oauth-introspect"

Variables

View Source
var (
	ErrKeyNotFound          = errors.New("key not found")
	ErrInvalidJobState      = errors.New("invalid job state")
	ErrCreateJob            = errors.New("failed to create job")
	ErrUpdateJob            = errors.New("failed to update job")
	ErrUnsupportedMode      = errors.New("unsupported mode")
	ErrReadToByteFailed     = errors.New("failed to read data to bytes")
	ErrUnsupportedOperation = errors.New("unsupported operation")
	ErrCSVUploadFailure     = errors.New("CSV upload failure")
)
View Source
var ErrCannotReadMetadata = errors.New("cannot read object metadata, it is possible you don't have the correct permissions set") // nolint:lll
View Source
var ErrCreateMetadata = errors.New("error in CreateMetadata")
View Source
var ErrExternalIdEmpty = errors.New("external id is required")
View Source
var ErrUnknownURLResource = errors.New("unknown URL resource")

Functions

func APIVersionSOAP

func APIVersionSOAP() string

func GetRemoteResource

func GetRemoteResource(orgId, channelId string) string

Types

type BulkOperationMode

type BulkOperationMode string

type BulkOperationParams

type BulkOperationParams struct {
	// The name of the object we are writing, e.g. "Account"
	ObjectName string // required

	// The name of a field on the object which is an External ID. Provided in the case of upserts, not inserts
	ExternalIdField string

	// The path to the CSV file we are writing
	CSVData io.Reader // required

	// Salesforce operation mode
	Mode BulkOperationMode
}

BulkOperationParams defines how we are writing data to a SaaS API.

type BulkOperationResult

type BulkOperationResult struct {
	// State is the state of the bulk job process
	State string `json:"state"`
	// JobId is the ID of the bulk job process
	JobId string `json:"jobId"`
}

BulkOperationResult is what's returned from writing data via the BulkOperation call.

type CalloutOptions

type CalloutOptions struct {
	AllowMergeFieldsInBody      bool `json:"allowMergeFieldsInBody"`
	AllowMergeFieldsInHeader    bool `json:"allowMergeFieldsInHeader"`
	GenerateAuthorizationHeader bool `json:"generateAuthorizationHeader"`
}

type Connector

type Connector struct {
	BaseURL   string
	Client    *common.JSONHTTPClient
	XMLClient *common.XMLHTTPClient
}

Connector is a Salesforce connector.

func NewConnector

func NewConnector(opts ...Option) (conn *Connector, outErr error)

NewConnector returns a new Salesforce connector.

func (*Connector) BulkDelete

func (c *Connector) BulkDelete(ctx context.Context, params BulkOperationParams) (*BulkOperationResult, error)

BulkDelete launches async Bulk Job to delete records. https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/create_job.htm

After creation inspect newly launched Bulk Job via: * GetJobInfo * GetJobResults * GetSuccessfulJobResults.

func (*Connector) BulkQuery

func (c *Connector) BulkQuery(
	ctx context.Context,
	query string,
	includeDeleted bool,
) (*GetJobInfoResult, error)

BulkQuery launches async Query job for bulk reading.

Design your SOQL query string you want to execute. Have a look at Salesforce documentation to know what clauses are not recommended for usage (under Request Body section). https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/query_create_job.htm To know more about SOQL syntax: https://developer.salesforce.com/docs/atlas.en-us.250.0.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select.htm

After creation inspect newly launched Bulk Job via: * GetBulkQueryInfo * GetBulkQueryResults.

func (*Connector) BulkRead

func (c *Connector) BulkRead(ctx context.Context, params common.ReadParams) (*GetJobInfoResult, error)

BulkRead launches async Query job for bulk reading. It is similar to BulkQuery. Check it for more info.

Usage example:

BulkRead(ctx, common.ReadParams{
	ObjectName: "accounts",
	Since: time.Now().Add(-15 * time.Minute)
	Deleted: true,
})

func (*Connector) BulkWrite

func (c *Connector) BulkWrite(
	ctx context.Context,
	params BulkOperationParams,
) (*BulkOperationResult, error)

BulkWrite launches async Bulk Job to upsert records. https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/create_job.htm

After creation inspect newly launched Bulk Job via: * GetJobInfo * GetJobResults * GetSuccessfulJobResults.

func (*Connector) CreateMetadata

func (c *Connector) CreateMetadata(ctx context.Context, data []byte, accessToken string) (string, error)

CreateMetadata creates custom metadata. Requires non-expired access token to be passed directly. According to documentation every XML type of request must include SessionHeader with access token. See: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_header_sessionheader.htm.

func (*Connector) GetBulkQueryInfo

func (c *Connector) GetBulkQueryInfo(ctx context.Context, jobId string) (*GetJobInfoResult, error)

GetBulkQueryInfo returns information status about a Query Job, which was created via BulkRead or BulkQuery. https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/query_get_one_job.htm

func (*Connector) GetBulkQueryResults

func (c *Connector) GetBulkQueryResults(ctx context.Context, jobId string) (*http.Response, error)

GetBulkQueryResults returns completed data from bulk query. https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/query_get_job_results.htm

func (*Connector) GetJobInfo

func (c *Connector) GetJobInfo(ctx context.Context, jobId string) (*GetJobInfoResult, error)

GetJobInfo returns information status about an Ingest Job, which was created via BulkWrite or BulkDelete. https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/get_job_info.htm

func (*Connector) GetJobResults

func (c *Connector) GetJobResults(ctx context.Context, jobId string) (*JobResults, error)

GetJobResults returns explanation on Ingest Job status. In case of success, only metadata marking such state is returned. In case of failure, reasons for error are collected and returned. For more on failures refer to the docs below. https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/get_job_failed_results.htm

func (*Connector) GetOrganizationId

func (c *Connector) GetOrganizationId(ctx context.Context) (string, error)

func (*Connector) GetSuccessfulJobResults

func (c *Connector) GetSuccessfulJobResults(ctx context.Context, jobId string) (*http.Response, error)

GetSuccessfulJobResults returns completed data from ingest job. If you know that Job was successful from running "info" methods, by calling this method you can get record results for this operation (write or delete). https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/get_job_successful_results.htm

func (*Connector) GetURL

func (c *Connector) GetURL(resource string, _ map[string]any) (string, error)

func (*Connector) HTTPClient

func (c *Connector) HTTPClient() *common.HTTPClient

func (*Connector) JSONHTTPClient

func (c *Connector) JSONHTTPClient() *common.JSONHTTPClient

JSONHTTPClient returns the underlying JSON HTTP client.

func (*Connector) Limits

func (c *Connector) Limits(ctx context.Context) (*LimitsResponse, error)

func (*Connector) ListIngestJobsInfo

func (c *Connector) ListIngestJobsInfo(ctx context.Context, jobIDs ...string) ([]GetJobInfoResult, error)

ListIngestJobsInfo returns information about Ingest Jobs. If jobIds are provided, only those jobs are returned. It is possible to get information about all current ingest jobs by not providing any jobIds. Note that Salesforce returns terminal state jobs from a maximum of 7 days ago. nolint:funlen,cyclop

func (*Connector) ListObjectMetadata

func (c *Connector) ListObjectMetadata(
	ctx context.Context,
	objectNames []string,
) (*common.ListObjectMetadataResult, error)

ListObjectMetadata returns object metadata for each object name provided.

func (*Connector) Provider

func (c *Connector) Provider() providers.Provider

Provider returns the connector provider.

func (*Connector) Read

func (c *Connector) Read(ctx context.Context, config common.ReadParams) (*common.ReadResult, error)

Read reads data from Salesforce. By default, it will read all rows (backfill). However, if Since is set, it will read only rows that have been updated since the specified time.

func (*Connector) String

func (c *Connector) String() string

String returns a string representation of the connector, which is useful for logging / debugging.

func (*Connector) Write

func (c *Connector) Write(ctx context.Context, config common.WriteParams) (*common.WriteResult, error)

Write will write data to Salesforce.

type Credential

type Credential interface {
	DestinationResourceName() string
}

type EventChannel

type EventChannel struct {
	Id       string                `json:"Id,omitempty"`
	FullName string                `json:"FullName"`
	Metadata *EventChannelMetadata `json:"Metadata"`
}

nolint:tagliatelle

type EventChannelMember

type EventChannelMember struct {
	Id       string                      `json:"Id,omitempty"`
	FullName string                      `json:"FullName"`
	Metadata *EventChannelMemberMetadata `json:"Metadata"`
}

nolint:tagliatelle

type EventChannelMemberMetadata

type EventChannelMemberMetadata struct {
	EventChannel   string `json:"eventChannel"`
	SelectedEntity string `json:"selectedEntity,omitempty"`
}

type EventChannelMetadata

type EventChannelMetadata struct {
	ChannelType string `json:"channelType"`
	Label       string `json:"label"`
}

type EventRelayConfig

type EventRelayConfig struct {
	Id                      string                    `json:"Id,omitempty"`
	FullName                string                    `json:"FullName,omitempty"`
	Metadata                *EventRelayConfigMetadata `json:"Metadata,omitempty"`
	DeveloperName           string                    `json:"DeveloperName,omitempty"`
	DestinationResourceName string                    `json:"DestinationResourceName,omitempty"`
	EventChannel            string                    `json:"EventChannel,omitempty"`
}

nolint:tagliatelle

type EventRelayConfigMetadata

type EventRelayConfigMetadata struct {
	DestinationResourceName string `json:"destinationResourceName,omitempty"`
	EventChannel            string `json:"eventChannel,omitempty"`
	State                   string `json:"state,omitempty"`
}

type FailInfo

type FailInfo struct {
	FailureType   string              `json:"failureType"`
	FailedUpdates map[string][]string `json:"failedUpdates,omitempty"`
	FailedCreates map[string][]string `json:"failedCreates,omitempty"`
	Reason        string              `json:"reason,omitempty"`
}

type GetJobInfoResult

type GetJobInfoResult struct {
	Id                     string            `json:"id"`
	Object                 string            `json:"object"`
	CreatedById            string            `json:"createdById"`
	ExternalIdFieldName    string            `json:"externalIdFieldName,omitempty"`
	State                  string            `json:"state"`
	Operation              BulkOperationMode `json:"operation"`
	ColumnDelimiter        string            `json:"columnDelimiter"`
	LineEnding             string            `json:"lineEnding"`
	NumberRecordsFailed    float64           `json:"numberRecordsFailed"`
	NumberRecordsProcessed float64           `json:"numberRecordsProcessed"`
	ErrorMessage           string            `json:"errorMessage"`

	ApexProcessingTime      float64 `json:"apexProcessingTime,omitempty"`
	ApiActiveProcessingTime float64 `json:"apiActiveProcessingTime,omitempty"`
	ApiVersion              float64 `json:"apiVersion,omitempty"`
	ConcurrencyMode         string  `json:"concurrencyMode,omitempty"`
	ContentType             string  `json:"contentType,omitempty"`
	CreatedDate             string  `json:"createdDate,omitempty"`
	JobType                 string  `json:"jobType,omitempty"`
	Retries                 float64 `json:"retries,omitempty"`
	SystemModstamp          string  `json:"systemModstamp,omitempty"`
	TotalProcessingTime     float64 `json:"totalProcessingTime,omitempty"`
	IsPkChunkingSupported   bool    `json:"isPkChunkingSupported,omitempty"`
}

func (GetJobInfoResult) IsStatusDone

func (r GetJobInfoResult) IsStatusDone() bool

type JobResults

type JobResults struct {
	JobId          string            `json:"jobId"`
	State          string            `json:"state"`
	FailureDetails *FailInfo         `json:"failureDetails,omitempty"`
	JobInfo        *GetJobInfoResult `json:"jobInfo,omitempty"`
	Message        string            `json:"message,omitempty"`
}

func (JobResults) IsStatusDone

func (r JobResults) IsStatusDone() bool

type LimitsResponse

type LimitsResponse struct {
	ActiveScratchOrgs struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"ActiveScratchOrgs"`
	AnalyticsExternalDataSizeMB struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"AnalyticsExternalDataSizeMB"`
	ConcurrentAsyncGetReportInstances struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"ConcurrentAsyncGetReportInstances"`
	ConcurrentEinsteinDataInsightsStoryCreation struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"ConcurrentEinsteinDataInsightsStoryCreation"`
	ConcurrentEinsteinDiscoveryStoryCreation struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"ConcurrentEinsteinDiscoveryStoryCreation"`
	ConcurrentSyncReportRuns struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"ConcurrentSyncReportRuns"`
	DailyAnalyticsDataflowJobExecutions struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyAnalyticsDataflowJobExecutions"`
	DailyAnalyticsUploadedFilesSizeMB struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyAnalyticsUploadedFilesSizeMB"`
	DailyFunctionsAPICallLimit struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyFunctionsApiCallLimit"`
	DailyAPIRequests struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyApiRequests"`
	DailyAsyncApexExecutions struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyAsyncApexExecutions"`
	DailyAsyncApexTests struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyAsyncApexTests"`
	DailyBulkAPIBatches struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyBulkApiBatches"`
	DailyBulkV2QueryFileStorageMB struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyBulkV2QueryFileStorageMB"`
	DailyBulkV2QueryJobs struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyBulkV2QueryJobs"`
	DailyDeliveredPlatformEvents struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyDeliveredPlatformEvents"`
	DailyDurableGenericStreamingAPIEvents struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyDurableGenericStreamingApiEvents"`
	DailyDurableStreamingAPIEvents struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyDurableStreamingApiEvents"`
	DailyEinsteinDataInsightsStoryCreation struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyEinsteinDataInsightsStoryCreation"`
	DailyEinsteinDiscoveryPredictAPICalls struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyEinsteinDiscoveryPredictAPICalls"`
	DailyEinsteinDiscoveryPredictionsByCDC struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyEinsteinDiscoveryPredictionsByCDC"`
	DailyEinsteinDiscoveryStoryCreation struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyEinsteinDiscoveryStoryCreation"`
	DailyGenericStreamingAPIEvents struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyGenericStreamingApiEvents"`
	DailyScratchOrgs struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyScratchOrgs"`
	DailyStandardVolumePlatformEvents struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyStandardVolumePlatformEvents"`
	DailyStreamingAPIEvents struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyStreamingApiEvents"`
	DailyWorkflowEmails struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DailyWorkflowEmails"`
	DataStorageMB struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DataStorageMB"`
	DurableStreamingAPIConcurrentClients struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"DurableStreamingApiConcurrentClients"`
	FileStorageMB struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"FileStorageMB"`
	HourlyAsyncReportRuns struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"HourlyAsyncReportRuns"`
	HourlyDashboardRefreshes struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"HourlyDashboardRefreshes"`
	HourlyDashboardResults struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"HourlyDashboardResults"`
	HourlyDashboardStatuses struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"HourlyDashboardStatuses"`
	HourlyLongTermIDMapping struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"HourlyLongTermIdMapping"`
	HourlyManagedContentPublicRequests struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"HourlyManagedContentPublicRequests"`
	HourlyODataCallout struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"HourlyODataCallout"`
	HourlyPublishedPlatformEvents struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"HourlyPublishedPlatformEvents"`
	HourlyPublishedStandardVolumePlatformEvents struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"HourlyPublishedStandardVolumePlatformEvents"`
	HourlyShortTermIDMapping struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"HourlyShortTermIdMapping"`
	HourlySyncReportRuns struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"HourlySyncReportRuns"`
	HourlyTimeBasedWorkflow struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"HourlyTimeBasedWorkflow"`
	MassEmail struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"MassEmail"`
	MonthlyEinsteinDiscoveryStoryCreation struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"MonthlyEinsteinDiscoveryStoryCreation"`
	Package2VersionCreates struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"Package2VersionCreates"`
	Package2VersionCreatesWithoutValidation struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"Package2VersionCreatesWithoutValidation"`
	PermissionSets struct {
		Max          int `json:"Max"`
		Remaining    int `json:"Remaining"`
		CreateCustom struct {
			Max       int `json:"Max"`
			Remaining int `json:"Remaining"`
		} `json:"CreateCustom"`
	} `json:"PermissionSets"`
	PlatformEventTriggersWithParallelProcessing struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"PlatformEventTriggersWithParallelProcessing"`
	PrivateConnectOutboundCalloutHourlyLimitMB struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"PrivateConnectOutboundCalloutHourlyLimitMB"`
	SingleEmail struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"SingleEmail"`
	StreamingAPIConcurrentClients struct {
		Max       int `json:"Max"`
		Remaining int `json:"Remaining"`
	} `json:"StreamingApiConcurrentClients"`
}

nolint:tagliatelle

type ListIngestJobsResult

type ListIngestJobsResult struct {
	Done           bool               `json:"done"`
	NextRecordsURL string             `json:"nextRecordsUrl"`
	Records        []GetJobInfoResult `json:"records"`
}

type NamedCredential

type NamedCredential struct {
	FullName string                   `json:"FullName"`
	Metadata *NamedCredentialMetadata `json:"Metadata"`

	// below exist in response, but not in request
	Id string `json:"Id,omitempty"`
}

nolint:tagliatelle

func (*NamedCredential) DestinationResourceName

func (n *NamedCredential) DestinationResourceName() string

type NamedCredentialMetadata

type NamedCredentialMetadata struct {
	AllowMergeFieldsInBody      bool                        `json:"allowMergeFieldsInBody,omitempty"`
	AllowMergeFieldsInHeader    bool                        `json:"allowMergeFieldsInHeader,omitempty"`
	GenerateAuthorizationHeader bool                        `json:"generateAuthorizationHeader,omitempty"`
	FullName                    string                      `json:"fullName,omitempty"                    validate:"required"`
	Label                       string                      `json:"label,omitempty"`
	NamedCredentialParameters   []*NamedCredentialParameter `json:"namedCredentialParameters,omitempty"`
	NamedCredentialType         string                      `json:"namedCredentialType,omitempty"`

	// Below are deprecated fields, but still in use in SF
	AuthProvider             string `json:"authProvider,omitempty"`
	AuthTokenEndpointUrl     string `json:"authTokenEndpointUrl,omitempty"` // nolint: revive
	AwsAccessKey             string `json:"awsAccessKey,omitempty"`
	AwsAccessSecret          string `json:"awsAccessSecret,omitempty"`
	AwsRegion                string `json:"awsRegion,omitempty"`
	AwsService               string `json:"awsService,omitempty"`
	Certificate              string `json:"certificate,omitempty"`
	Endpoint                 string `json:"endpoint,omitempty"`
	JwtAudience              string `json:"jwtAudience,omitempty"`
	JwtFormulaSubject        string `json:"jwtFormulaSubject,omitempty"`
	JwtIssuer                string `json:"jwtIssuer,omitempty"`
	JwtSigningCertificate    string `json:"jwtSigningCertificate,omitempty"`
	JwtTextSubject           string `json:"jwtTextSubject,omitempty"`
	JwtValidityPeriodSeconds int    `json:"jwtValidityPeriodSeconds,omitempty"`
	OauthRefreshToken        string `json:"oauthRefreshToken,omitempty"`
	OauthScope               string `json:"oauthScope,omitempty"`
	OauthToken               string `json:"oauthToken,omitempty"`
	Password                 string `json:"password,omitempty"`
	PrincipalType            string `json:"principalType,omitempty"`
	Protocol                 string `json:"protocol,omitempty"`
	Username                 string `json:"username,omitempty"`
}

nolint: lll

type NamedCredentialParameter

type NamedCredentialParameter struct {
	Certificate               string `json:"certificate"`
	Description               string `json:"description"`
	ExternalCredential        string `json:"externalCredential"`
	OutboundNetworkConnection string `json:"outboundNetworkConnection"`
	ParameterName             string `json:"parameterName"`
	ParameterType             string `json:"parameterType"`
	ParameterValue            string `json:"parameterValue"`
	SequenceNumber            int    `json:"sequenceNumber"`
}

type NamedCredentialParameterType

type NamedCredentialParameterType string
const (
	AllowedManagedPackageNamespaces NamedCredentialParameterType = "AllowedManagedPackageNamespaces"
	ClientCertificate               NamedCredentialParameterType = "ClientCertificate"
	HttpHeader                      NamedCredentialParameterType = "HttpHeader"
	OutboundNetworkConnection       NamedCredentialParameterType = "OutboundNetworkConnection"
	Url                             NamedCredentialParameterType = "Url"
)

nolint: revive

type Option

type Option = func(params *parameters)

Option is a function which mutates the salesforce connector configuration.

func WithAuthenticatedClient

func WithAuthenticatedClient(client common.AuthenticatedHTTPClient) Option

func WithClient

func WithClient(ctx context.Context, client *http.Client,
	config *oauth2.Config, token *oauth2.Token, opts ...common.OAuthOption,
) Option

func WithWorkspace

func WithWorkspace(workspaceRef string) Option

type SFAPIResponseBody

type SFAPIResponseBody struct {
	Id       string        `json:"id"`
	Success  bool          `json:"success"`
	Errors   []interface{} `json:"errors"`
	Infos    []interface{} `json:"infos"`
	Warnings []interface{} `json:"warnings"`
}

type ToolingApiBaseParams

type ToolingApiBaseParams struct {
	DeveloperName   string `json:"DeveloperName,omitempty"`
	Language        string `json:"Language,omitempty"`
	ManageableState string `json:"ManageableState,omitempty"`
	MasterLabel     string `json:"MasterLabel,omitempty"`
	NamespacePrefix string `json:"NamespacePrefix,omitempty"`
}

nolint: tagliatelle

Jump to

Keyboard shortcuts

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