Documentation ¶
Overview ¶
nolint:lll
Package providers provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
nolint:ireturn
Index ¶
- Constants
- Variables
- func Init()
- func SetInfo(provider Provider, info ProviderInfo)
- func SetupMockProvider()
- type ApiKeyAsBasicOpts
- type ApiKeyAsBasicOptsFieldUsed
- type ApiKeyOpts
- type ApiKeyOptsAttachmentType
- type ApiKeyOptsHeader
- type ApiKeyOptsQuery
- type AuthType
- type BasicAuthOpts
- type BasicParams
- type BulkWriteSupport
- type CatalogOption
- type CatalogType
- type CatalogWrapper
- type CustomCatalog
- type Labels
- type Media
- type MediaTypeDarkMode
- type MediaTypeRegular
- type NewClientParams
- type OAuth2AuthCodeParams
- type OAuth2ClientCredentialsParams
- type Oauth2Opts
- type Oauth2OptsGrantType
- type Provider
- type ProviderInfo
- func (i *ProviderInfo) GetApiKeyHeader(apiKey string) (string, string, error)
- func (i *ProviderInfo) GetApiKeyQueryParamName() (string, error)
- func (i *ProviderInfo) GetOption(key string) (string, bool)
- func (i *ProviderInfo) NewClient(ctx context.Context, params *NewClientParams) (common.AuthenticatedHTTPClient, error)
- func (i *ProviderInfo) Override(override *ProviderInfo) *ProviderInfo
- func (i *ProviderInfo) SubstituteWith(vars []catalogreplacer.CatalogVariable) error
- type ProviderOpts
- type Support
- type TokenMetadataFields
Constants ¶
const ( LabelExperimental = "experimental" LabelValueTrue = "true" )
const Apollo = "apollo"
const Insightly = "insightly"
Variables ¶
var ( ErrCatalogNotFound = errors.New("catalog not found") ErrProviderNotFound = errors.New("provider not found") ErrClient = errors.New("client creation failed") ErrRetrievingHeaderApiKeyName = errors.New("provider information missing header name for API Key") ErrRetrievingQueryParamApiKeyName = errors.New("provider information missing query parameter name for API Key") )
Functions ¶
func SetInfo ¶
func SetInfo(provider Provider, info ProviderInfo)
SetInfo sets the information for a specific provider in the catalog. This is useful to enable experimental providers or to override the default provider information. This is primarily used to initialize the provider catalog. Generally speaking, once the provider catalog is initialized, it should not be modified. That having been said, there are some use cases where it is useful to override the provider information, such as when testing new configurations. This function is not thread-safe and should be called before the provider catalog is read.
func SetupMockProvider ¶
func SetupMockProvider()
SetupMockProvider sets up the mock provider. You need to call this explicitly if you want to use the mock provider in your tests.
Types ¶
type ApiKeyAsBasicOpts ¶
type ApiKeyAsBasicOpts struct { // FieldUsed whether the API key should be used as the username or password. FieldUsed ApiKeyAsBasicOptsFieldUsed `json:"fieldUsed,omitempty"` // KeyFormat How to transform the API key in to a basic auth user:pass string. The %s is replaced with the API key value. KeyFormat string `json:"keyFormat,omitempty"` }
ApiKeyAsBasicOpts when this object is present, it means that this provider uses Basic Auth to actually collect an API key
type ApiKeyAsBasicOptsFieldUsed ¶
type ApiKeyAsBasicOptsFieldUsed string
ApiKeyAsBasicOptsFieldUsed whether the API key should be used as the username or password.
const ( PasswordField ApiKeyAsBasicOptsFieldUsed = "password" UsernameField ApiKeyAsBasicOptsFieldUsed = "username" )
Defines values for ApiKeyAsBasicOptsFieldUsed.
type ApiKeyOpts ¶
type ApiKeyOpts struct { // AttachmentType How the API key should be attached to requests. AttachmentType ApiKeyOptsAttachmentType `json:"attachmentType" validate:"required"` // DocsURL URL with more information about how to get or use an API key. DocsURL string `json:"docsURL,omitempty"` // Header Configuration for API key in header. Must be provided if type is in-header. Header *ApiKeyOptsHeader `json:"header,omitempty"` // Query Configuration for API key in query parameter. Must be provided if type is in-query. Query *ApiKeyOptsQuery `json:"query,omitempty"` }
ApiKeyOpts Configuration for API key. Must be provided if authType is apiKey.
type ApiKeyOptsAttachmentType ¶
type ApiKeyOptsAttachmentType string
ApiKeyOptsAttachmentType How the API key should be attached to requests.
const ( Header ApiKeyOptsAttachmentType = "header" Query ApiKeyOptsAttachmentType = "query" )
Defines values for ApiKeyOptsAttachmentType.
type ApiKeyOptsHeader ¶
type ApiKeyOptsHeader struct { // Name The name of the header to be used for the API key. Name string `json:"name"` // ValuePrefix The prefix to be added to the API key value when it is sent in the header. ValuePrefix string `json:"valuePrefix,omitempty"` }
ApiKeyOptsHeader Configuration for API key in header. Must be provided if type is in-header.
type ApiKeyOptsQuery ¶
type ApiKeyOptsQuery struct { // Name The name of the query parameter to be used for the API key. Name string `json:"name"` }
ApiKeyOptsQuery Configuration for API key in query parameter. Must be provided if type is in-query.
type BasicAuthOpts ¶
type BasicAuthOpts struct { // ApiKeyAsBasic If true, the provider uses an API key which then gets encoded as a basic auth user:pass string. ApiKeyAsBasic bool `json:"apiKeyAsBasic,omitempty"` // ApiKeyAsBasicOpts when this object is present, it means that this provider uses Basic Auth to actually collect an API key ApiKeyAsBasicOpts *ApiKeyAsBasicOpts `json:"apiKeyAsBasicOpts,omitempty"` // DocsURL URL with more information about how to get or use an API key. DocsURL string `json:"docsURL,omitempty"` }
BasicAuthOpts Configuration for Basic Auth. Optional.
type BasicParams ¶
BasicParams is the parameters to create a basic auth client.
type BulkWriteSupport ¶
type BulkWriteSupport struct { Delete bool `json:"delete"` Insert bool `json:"insert"` Update bool `json:"update"` Upsert bool `json:"upsert"` }
BulkWriteSupport defines model for BulkWriteSupport.
type CatalogOption ¶
type CatalogOption func(params *catalogParams)
func WithCatalog ¶
func WithCatalog(c *CatalogWrapper) CatalogOption
WithCatalog is an option that can be used to override the default catalog.
type CatalogType ¶
type CatalogType map[string]ProviderInfo
CatalogType defines model for CatalogType.
type CatalogWrapper ¶
type CatalogWrapper struct { Catalog CatalogType `json:"catalog"` // Timestamp An RFC3339 formatted timestamp of when the catalog was generated. Timestamp string `json:"timestamp" validate:"required"` }
CatalogWrapper defines model for CatalogWrapper.
func ReadCatalog ¶
func ReadCatalog(opts ...CatalogOption) (*CatalogWrapper, error)
ReadCatalog is used to get the catalog.
type CustomCatalog ¶
type CustomCatalog struct {
// contains filtered or unexported fields
}
func NewCustomCatalog ¶
func NewCustomCatalog(opts ...CatalogOption) CustomCatalog
NewCustomCatalog allows to apply modifiers on the base catalog, to tweak its content. Just like the default catalog it supports reading data, resolves variable substitutions.
func (CustomCatalog) ReadCatalog ¶
func (c CustomCatalog) ReadCatalog() (*CatalogWrapper, error)
func (CustomCatalog) ReadInfo ¶
func (c CustomCatalog) ReadInfo(provider Provider, vars ...catalogreplacer.CatalogVariable) (*ProviderInfo, error)
type Media ¶
type Media struct { // DarkMode Media to be used in dark mode. DarkMode *MediaTypeDarkMode `json:"darkMode,omitempty"` // Regular Media for light/regular mode. Regular *MediaTypeRegular `json:"regular,omitempty"` }
Media defines model for Media.
type MediaTypeDarkMode ¶
type MediaTypeDarkMode struct { // IconURL URL to the icon for the provider that is to be used in dark mode. IconURL string `json:"iconURL,omitempty"` // LogoURL URL to the logo for the provider that is to be used in dark mode. LogoURL string `json:"logoURL,omitempty"` }
MediaTypeDarkMode Media to be used in dark mode.
type MediaTypeRegular ¶
type MediaTypeRegular struct { // IconURL URL to the icon for the provider. IconURL string `json:"iconURL,omitempty"` // LogoURL URL to the logo for the provider. LogoURL string `json:"logoURL,omitempty"` }
MediaTypeRegular Media for light/regular mode.
type NewClientParams ¶
type NewClientParams struct { // Debug will enable debug mode for the client. Debug bool // Client is the http client to use for the client. If // the value is nil, the default http client will be used. Client *http.Client // BasicCreds is the basic auth credentials to use for the client. // If the provider uses basic auth, this field must be set. BasicCreds *BasicParams // OAuth2ClientCreds is the client credentials to use for the client. // If the provider uses client credentials, this field must be set. OAuth2ClientCreds *OAuth2ClientCredentialsParams // OAuth2AuthCodeCreds is the auth code credentials to use for the client. // If the provider uses auth code, this field must be set. OAuth2AuthCodeCreds *OAuth2AuthCodeParams // ApiKey is the api key to use for the client. If the provider uses api-key // auth, this field must be set. ApiKey string }
NewClientParams is the parameters to create a new HTTP client.
type OAuth2AuthCodeParams ¶
type OAuth2AuthCodeParams struct { Config *oauth2.Config Token *oauth2.Token Options []common.OAuthOption }
OAuth2AuthCodeParams is the parameters to create an OAuth2 auth code client.
type OAuth2ClientCredentialsParams ¶
type OAuth2ClientCredentialsParams struct { Config *clientcredentials.Config Options []common.OAuthOption }
type Oauth2Opts ¶
type Oauth2Opts struct { // Audience A list of URLs that represent the audience for the token, which is needed for some client credential grant flows. Audience []string `json:"audience,omitempty"` // AuthURL The authorization URL. AuthURL string `json:"authURL,omitempty"` AuthURLParams map[string]string `json:"authURLParams,omitempty"` // DocsURL URL with more information about where to retrieve Client ID and Client Secret, etc. DocsURL string `json:"docsURL,omitempty"` // ExplicitScopesRequired Whether scopes are required to be known ahead of the OAuth flow. ExplicitScopesRequired bool `json:"explicitScopesRequired"` // ExplicitWorkspaceRequired Whether the workspace is required to be known ahead of the OAuth flow. ExplicitWorkspaceRequired bool `json:"explicitWorkspaceRequired"` GrantType Oauth2OptsGrantType `json:"grantType"` // TokenMetadataFields Fields to be used to extract token metadata from the token response. TokenMetadataFields TokenMetadataFields `json:"tokenMetadataFields"` // TokenURL The token URL. TokenURL string `json:"tokenURL" validate:"required"` }
Oauth2Opts Configuration for OAuth2.0. Must be provided if authType is oauth2.
type Oauth2OptsGrantType ¶
type Oauth2OptsGrantType string
Oauth2OptsGrantType defines model for Oauth2Opts.GrantType.
const ( AuthorizationCode Oauth2OptsGrantType = "authorizationCode" AuthorizationCodePKCE Oauth2OptsGrantType = "authorizationCodePKCE" ClientCredentials Oauth2OptsGrantType = "clientCredentials" Password Oauth2OptsGrantType = "password" )
Defines values for Oauth2OptsGrantType.
type Provider ¶
type Provider = string
Provider defines model for Provider.
const AWeber Provider = "aWeber"
const ActiveCampaign Provider = "activeCampaign"
const AcuityScheduling Provider = "acuityScheduling"
const Adobe Provider = "adobe"
const Aha Provider = "aha"
const Aircall Provider = "aircall"
const Airtable Provider = "airtable"
const Amplitude Provider = "amplitude"
const Anthropic Provider = "anthropic"
const Asana Provider = "asana"
const Ashby Provider = "ashby"
const Atlassian Provider = "atlassian"
const Attio Provider = "attio"
const Basecamp Provider = "basecamp"
const Bird Provider = "bird"
const Box Provider = "box"
const Braintree Provider = "braintree"
const Brevo Provider = "brevo"
const Bynder Provider = "bynder"
const Calendly Provider = "calendly"
const CallRail Provider = "callRail"
const CampaignMonitor Provider = "campaignMonitor"
const Capsule Provider = "capsule"
const ChargeOver Provider = "chargeOver"
const Chargebee Provider = "chargebee"
const ChartMogul Provider = "chartMogul"
const Clari Provider = "clari"
const ClickUp Provider = "clickup"
const Close Provider = "close"
const Coda Provider = "coda"
const ConstantContact Provider = "constantContact"
const Copper Provider = "copper"
const Crunchbase Provider = "crunchbase"
const Delighted Provider = "delighted"
const Discord Provider = "discord"
const Discourse Provider = "discourse"
const Dixa Provider = "dixa"
const Domo Provider = "domo"
const Dovetail Provider = "dovetail"
const Drift Provider = "drift"
const Drip Provider = "drip"
const Facebook Provider = "facebook"
const Figma Provider = "figma"
const Formstack Provider = "formstack"
const Freshchat Provider = "freshchat"
const Freshdesk Provider = "freshdesk"
const Freshsales Provider = "freshsales"
const Freshservice Provider = "freshservice"
const Front Provider = "front"
const G2 Provider = "g2"
const Gainsight Provider = "gainsight"
const Geckoboard Provider = "geckoboard"
const GetResponse Provider = "getResponse"
const GitLab Provider = "gitLab"
const Github Provider = "github"
const GoToWebinar Provider = "goToWebinar"
const Gong Provider = "gong"
const (
Google Provider = "google"
)
const (
Gorgias Provider = "gorgias"
)
const Guru Provider = "guru"
const HelpScoutMailbox Provider = "helpScoutMailbox"
const Hive Provider = "hive"
const Hubspot Provider = "hubspot"
const Hunter Provider = "hunter"
const Instagram Provider = "instagram"
const Instantly Provider = "instantly"
const Intercom Provider = "intercom"
const Iterable Provider = "iterable"
const Jotform Provider = "jotform"
const Keap Provider = "keap"
const Kit Provider = "kit"
const Klaviyo Provider = "klaviyo"
const Lemlist Provider = "lemlist"
const LinkedIn Provider = "linkedIn"
const Mailgun Provider = "mailgun"
const Marketo Provider = "marketo"
const Maxio Provider = "maxio"
const Microsoft Provider = "microsoft"
Supported Microsoft Products includes OneDrive Outlook Excel Edge Extensions Sharepoint OneNote Notifications Todos Teams Insights Planner and Personal Contacts.
const Miro Provider = "miro"
const Mixmax Provider = "mixmax"
const Mock Provider = "mock"
Mock is a mock provider that can be used for testing. When the mock connector is used, it's added to the catalog manually. That is why there's no init() function in this file.
const Monday Provider = "monday"
const Mural Provider = "mural"
const Notion Provider = "notion"
const Nutshell Provider = "nutshell"
const OpenAI Provider = "openAI"
const Outreach Provider = "outreach"
const Pinterest Provider = "pinterest"
const Pipedrive Provider = "pipedrive"
const Pipeliner Provider = "pipeliner"
const Podium Provider = "podium"
const ProductBoard Provider = "productBoard"
const Rebilly Provider = "rebilly"
const Recurly Provider = "recurly"
const RedditAds Provider = "redditAds"
const RingCentral Provider = "ringCentral"
const Salesflare Provider = "salesflare"
const Salesforce Provider = "salesforce"
const SalesforceMarketing Provider = "salesforceMarketing"
const Salesloft Provider = "salesloft"
const Seismic Provider = "seismic"
const Sellsy Provider = "sellsy"
const SendGrid Provider = "sendGrid"
const ServiceNow Provider = "serviceNow"
const Shopify Provider = "shopify"
const Slack Provider = "slack"
const Smartlead Provider = "smartlead"
const Smartsheet Provider = "smartsheet"
const SnapchatAds Provider = "snapchatAds"
const StackExchange Provider = "stackExchange"
const Stripe Provider = "stripe"
const SugarCRM Provider = "sugarCRM"
const SurveyMonkey Provider = "surveyMonkey"
const Talkdesk Provider = "talkdesk"
const Teamleader Provider = "teamleader"
const Teamwork Provider = "teamwork"
const Timely Provider = "timely"
const Typeform Provider = "typeform"
const Webflow Provider = "webflow"
const WordPress Provider = "wordPress"
const Wrike Provider = "wrike"
const Zoho Provider = "zoho"
const ZohoDesk Provider = "zohoDesk"
const Zoom Provider = "zoom"
const Zuora Provider = "zuora"
type ProviderInfo ¶
type ProviderInfo struct { // ApiKeyOpts Configuration for API key. Must be provided if authType is apiKey. ApiKeyOpts *ApiKeyOpts `json:"apiKeyOpts,omitempty"` // AuthType The type of authentication required by the provider. AuthType AuthType `json:"authType" validate:"required"` // BaseURL The base URL for making API requests. BaseURL string `json:"baseURL" validate:"required"` // BasicOpts Configuration for Basic Auth. Optional. BasicOpts *BasicAuthOpts `json:"basicOpts,omitempty"` // DisplayName The display name of the provider, if omitted, defaults to provider name. DisplayName string `json:"displayName,omitempty"` Labels *Labels `json:"labels,omitempty"` Media *Media `json:"media,omitempty"` Name string `json:"name"` // Oauth2Opts Configuration for OAuth2.0. Must be provided if authType is oauth2. Oauth2Opts *Oauth2Opts `json:"oauth2Opts,omitempty"` // PostAuthInfoNeeded If true, we require additional information after auth to start making requests. PostAuthInfoNeeded bool `json:"postAuthInfoNeeded,omitempty"` // ProviderOpts Additional provider-specific metadata. ProviderOpts ProviderOpts `json:"providerOpts"` // Support The supported features for the provider. Support Support `json:"support" validate:"required"` }
ProviderInfo defines model for ProviderInfo.
func ReadInfo ¶
func ReadInfo(provider Provider, vars ...catalogreplacer.CatalogVariable) (*ProviderInfo, error)
ReadInfo reads the information from the catalog for specific provider. It also performs string substitution on the values in the config that are surrounded by {{}}, if vars are provided. The catalog variable will be applied such that `{{.VAR_NAME}}` string will be replaced with `VAR_VALUE`.
func (*ProviderInfo) GetApiKeyHeader ¶
func (i *ProviderInfo) GetApiKeyHeader(apiKey string) (string, string, error)
func (*ProviderInfo) GetApiKeyQueryParamName ¶
func (i *ProviderInfo) GetApiKeyQueryParamName() (string, error)
func (*ProviderInfo) NewClient ¶
func (i *ProviderInfo) NewClient(ctx context.Context, params *NewClientParams) (common.AuthenticatedHTTPClient, error)
NewClient will create a new authenticated client based on the provider's auth type.
func (*ProviderInfo) Override ¶
func (i *ProviderInfo) Override(override *ProviderInfo) *ProviderInfo
Override can be used to override the base URL of the provider, and could be used for other fields in the future.
func (*ProviderInfo) SubstituteWith ¶
func (i *ProviderInfo) SubstituteWith(vars []catalogreplacer.CatalogVariable) error
type ProviderOpts ¶
ProviderOpts Additional provider-specific metadata.
type Support ¶
type Support struct { BulkWrite BulkWriteSupport `json:"bulkWrite" validate:"required"` Proxy bool `json:"proxy"` Read bool `json:"read"` Subscribe bool `json:"subscribe"` Write bool `json:"write"` }
Support The supported features for the provider.
type TokenMetadataFields ¶
type TokenMetadataFields struct { ConsumerRefField string `json:"consumerRefField,omitempty"` ScopesField string `json:"scopesField,omitempty"` WorkspaceRefField string `json:"workspaceRefField,omitempty"` }
TokenMetadataFields Fields to be used to extract token metadata from the token response.
Source Files ¶
- aWeber.go
- activeCampaign.go
- acuityScheduling.go
- adobe.go
- aha.go
- aircall.go
- airtable.go
- amplitude.go
- anthropic.go
- apollo.go
- asana.go
- ashby.go
- atlassian.go
- attio.go
- basecamp.go
- bird.go
- blueshift.go
- box.go
- braintree.go
- brevo.go
- bynder.go
- calendly.go
- callRail.go
- campaignMonitor.go
- capsule.go
- catalog.go
- chargeOver.go
- chargebee.go
- chartMogul.go
- clari.go
- clickup.go
- close.go
- coda.go
- constantContact.go
- copper.go
- crunchbase.go
- customer.go
- delighted.go
- discord.go
- discourse.go
- dixa.go
- docusign.go
- domo.go
- dovetail.go
- drift.go
- drip.go
- dropbox.go
- dynamics.go
- facebook.go
- figma.go
- formstack.go
- freshchat.go
- freshdesk.go
- freshsales.go
- freshservice.go
- front.go
- g2.go
- gainsight.go
- geckoboard.go
- getResponse.go
- github.go
- gitlab.go
- gladly.go
- goToWebinar.go
- gong.go
- google.go
- gorgias.go
- guru.go
- helpScoutMailbox.go
- hive.go
- hubspot.go
- hunter.go
- insightly.go
- instagram.go
- instantly.go
- intercom.go
- ironclad.go
- iterable.go
- jotform.go
- keap.go
- kit.go
- klaviyo.go
- labels.go
- lemlist.go
- lever.go
- linkedIn.go
- mailgun.go
- marketo.go
- maxio.go
- microsoft.go
- miro.go
- mixmax.go
- mock.go
- monday.go
- mural.go
- notion.go
- nutshell.go
- openAI.go
- outreach.go
- paddle.go
- pinterest.go
- pipedrive.go
- pipeliner.go
- podium.go
- productBoard.go
- rebilly.go
- recurly.go
- redditAds.go
- ringCentral.go
- salesflare.go
- salesforce.go
- salesforceMarketing.go
- salesloft.go
- seismic.go
- sellsy.go
- sendGrid.go
- serviceNow.go
- shopify.go
- slack.go
- smartlead.go
- smartsheet.go
- snapchatAds.go
- stackExchange.go
- stripe.go
- sugarCRM.go
- surveyMonkey.go
- talkdesk.go
- teamleader.go
- teamwork.go
- timely.go
- typeform.go
- types.gen.go
- utils.go
- webflow.go
- wordPress.go
- wrike.go
- zendesk.go
- zoho.go
- zohoDesk.go
- zoom.go
- zuora.go
Directories ¶
Path | Synopsis |
---|---|
nolint
|
nolint |
nolint
|
nolint |
Package salesforce This file has bulk related functionality that is internal to this package.
|
Package salesforce This file has bulk related functionality that is internal to this package. |