diff --git a/providers/gong.go b/providers/gong.go index 970c9bf45..693be485b 100644 --- a/providers/gong.go +++ b/providers/gong.go @@ -37,8 +37,11 @@ func init() { }, Proxy: true, Read: true, - Subscribe: false, + Subscribe: true, Write: true, }, + SubscribeRequirements: &SubscribeRequirements{ + SubscribeByAPI: new(false), + }, }) } diff --git a/providers/google.go b/providers/google.go index 16193ada3..f4284d657 100644 --- a/providers/google.go +++ b/providers/google.go @@ -60,9 +60,13 @@ func init() { DisplayName: "Gmail", Support: Support{ Read: true, - Subscribe: false, + Subscribe: true, Write: true, }, + SubscribeRequirements: &SubscribeRequirements{ + Maintenance: new(true), + SubscribeByAPI: new(true), + }, }, }, Media: &Media{ diff --git a/providers/housecallPro.go b/providers/housecallPro.go index bc0abb50f..79fe1dfb7 100644 --- a/providers/housecallPro.go +++ b/providers/housecallPro.go @@ -24,7 +24,7 @@ func init() { }, Proxy: true, Read: true, - Subscribe: false, + Subscribe: true, Write: true, }, Media: &Media{ diff --git a/providers/outreach.go b/providers/outreach.go index 4790dc5b5..8c3247782 100644 --- a/providers/outreach.go +++ b/providers/outreach.go @@ -37,8 +37,11 @@ func init() { }, Proxy: true, Read: true, - Subscribe: false, + Subscribe: true, Write: true, }, + SubscribeRequirements: &SubscribeRequirements{ + SubscribeByAPI: new(true), + }, }) } diff --git a/providers/salesforce.go b/providers/salesforce.go index 0cfd72413..df6ebb6b6 100644 --- a/providers/salesforce.go +++ b/providers/salesforce.go @@ -79,6 +79,11 @@ func init() { // nolint:funlen }, }, }, + SubscribeRequirements: &SubscribeRequirements{ + Registration: new(true), + PostProcess: new(true), + SubscribeByAPI: new(true), + }, }, ModuleSalesforceAccountEngagement: { BaseURL: "https://pi.pardot.com", diff --git a/providers/salesloft.go b/providers/salesloft.go index 8ed0542aa..fa9b5ffdc 100644 --- a/providers/salesloft.go +++ b/providers/salesloft.go @@ -37,8 +37,11 @@ func init() { }, Proxy: true, Read: true, - Subscribe: false, + Subscribe: true, Write: true, }, + SubscribeRequirements: &SubscribeRequirements{ + SubscribeByAPI: new(true), + }, }) } diff --git a/providers/types.gen.go b/providers/types.gen.go index 3de0f0a47..460e8a575 100644 --- a/providers/types.gen.go +++ b/providers/types.gen.go @@ -108,45 +108,6 @@ func (e Oauth2OptsGrantType) Valid() bool { } } -// Defines values for SubscribeOptsRegistrationTiming. -const ( - SubscribeOptsRegistrationTimingInstallation SubscribeOptsRegistrationTiming = "installation" - SubscribeOptsRegistrationTimingIntegration SubscribeOptsRegistrationTiming = "integration" - SubscribeOptsRegistrationTimingProviderApp SubscribeOptsRegistrationTiming = "providerApp" -) - -// Valid indicates whether the value is a known member of the SubscribeOptsRegistrationTiming enum. -func (e SubscribeOptsRegistrationTiming) Valid() bool { - switch e { - case SubscribeOptsRegistrationTimingInstallation: - return true - case SubscribeOptsRegistrationTimingIntegration: - return true - case SubscribeOptsRegistrationTimingProviderApp: - return true - default: - return false - } -} - -// Defines values for SubscribeOptsSubscriptionScope. -const ( - SubscribeOptsSubscriptionScopeInstallation SubscribeOptsSubscriptionScope = "installation" - SubscribeOptsSubscriptionScopeIntegration SubscribeOptsSubscriptionScope = "integration" -) - -// Valid indicates whether the value is a known member of the SubscribeOptsSubscriptionScope enum. -func (e SubscribeOptsSubscriptionScope) Valid() bool { - switch e { - case SubscribeOptsSubscriptionScopeInstallation: - return true - case SubscribeOptsSubscriptionScopeIntegration: - return true - default: - return false - } -} - // AccessTokenOpts Configuration that defines how an OAuth 2.0 access token is attached to // outbound API requests. When provided, this configuration overrides the // default access-token handling behavior for the connector. @@ -400,6 +361,9 @@ type ModuleInfo struct { BaseURL string `json:"baseURL"` DisplayName string `json:"displayName"` + // SubscribeRequirements Declares which auxiliary steps a provider requires to support subscriptions, beyond the per-object subscribe call itself. + SubscribeRequirements *SubscribeRequirements `json:"subscribeRequirements,omitempty"` + // Support The supported features for the provider. Support Support `json:"support" validate:"required"` } @@ -498,9 +462,8 @@ type ProviderInfo struct { // ProviderAppMetadata Describes the provider-app-level fields that the Ampersand dashboard should collect from the builder when creating a ProviderApp for this provider. These descriptors tell the dashboard which form fields to render; the submitted values are stored in ProviderApp.metadata. ProviderAppMetadata *ProviderAppMetadata `json:"providerAppMetadata,omitempty"` - // ProviderOpts Additional provider-specific metadata. - ProviderOpts ProviderOpts `json:"providerOpts"` - SubscribeOpts *SubscribeOpts `json:"subscribeOpts,omitempty"` + // SubscribeRequirements Declares which auxiliary steps a provider requires to support subscriptions, beyond the per-object subscribe call itself. + SubscribeRequirements *SubscribeRequirements `json:"subscribeRequirements,omitempty"` // Support The supported features for the provider. Support Support `json:"support" validate:"required"` @@ -515,9 +478,6 @@ type ProviderMetadata struct { PostAuthentication []MetadataItemPostAuthentication `json:"postAuthentication,omitempty"` } -// ProviderOpts Additional provider-specific metadata. -type ProviderOpts map[string]string - // SearchOperators defines model for SearchOperators. type SearchOperators struct { Equals bool `json:"equals"` @@ -528,23 +488,20 @@ type SearchSupport struct { Operators SearchOperators `json:"operators"` } -// SubscribeOpts defines model for SubscribeOpts. -type SubscribeOpts struct { - // RegistrationTiming The timing of the registration. - RegistrationTiming SubscribeOptsRegistrationTiming `json:"registrationTiming"` +// SubscribeRequirements Declares which auxiliary steps a provider requires to support subscriptions, beyond the per-object subscribe call itself. +type SubscribeRequirements struct { + // Maintenance Whether the subscription requires periodic maintenance. Some providers expire subscriptions/watches after a fixed TTL, so the subscription must be renewed on a schedule to remain active. + Maintenance *bool `json:"maintenance,omitempty"` - // SubscriptionScope The scope of the subscription. - SubscriptionScope SubscribeOptsSubscriptionScope `json:"subscriptionScope"` + // PostProcess Whether subscribing requires a third-party setup step that the connector instance itself cannot perform. Examples: Salesforce requires AWS EventBridge configuration; Gmail requires a Google Pub/Sub topic to be configured. Any configuration that must happen outside the connector falls into post-process. + PostProcess *bool `json:"postProcess,omitempty"` - // TargetURLScope The scope of the target URL. - TargetURLScope interface{} `json:"targetURLScope"` -} - -// SubscribeOptsRegistrationTiming The timing of the registration. -type SubscribeOptsRegistrationTiming string + // Registration Whether the provider requires a one-time registration step that is shared across all subscribed objects. The subscribe method is object-scoped, so if a separate API call is needed beyond per-object configuration (e.g., registering a single webhook/endpoint that all object subscriptions hang off of), registration is required. + Registration *bool `json:"registration,omitempty"` -// SubscribeOptsSubscriptionScope The scope of the subscription. -type SubscribeOptsSubscriptionScope string + // SubscribeByAPI Whether the provider supports programmatic subscription via API. If false, provider may still support webhooks via manual configuration in UI. + SubscribeByAPI *bool `json:"subscribeByAPI,omitempty"` +} // SubscribeSupport defines model for SubscribeSupport. type SubscribeSupport struct { diff --git a/providers/zoho.go b/providers/zoho.go index 2ca82d95a..92b62d0a3 100644 --- a/providers/zoho.go +++ b/providers/zoho.go @@ -50,7 +50,7 @@ func init() { }, Proxy: true, Read: true, - Subscribe: false, + Subscribe: true, Write: true, }, Media: &Media{ @@ -70,9 +70,13 @@ func init() { DisplayName: "Zoho CRM", Support: Support{ Read: true, - Subscribe: false, + Subscribe: true, Write: true, }, + SubscribeRequirements: &SubscribeRequirements{ + Maintenance: new(true), + SubscribeByAPI: new(true), + }, }, ModuleZohoDesk: { // E.g. www.desk.zoho.com, www.desk.zoho.eu, www.desk.zoho.in, etc.