Documentation
¶
Index ¶
- Variables
- type Account
- type App
- type Client
- func (c *Client) AcquireUserToken(ctx context.Context, externalUserID string, webhookURI string) (*UserTokenResponse, error)
- func (c *Client) DeleteAccount(ctx context.Context, accountId string) error
- func (c *Client) DeleteAccounts(ctx context.Context, appID string) error
- func (c *Client) DeleteDeployedTrigger(ctx context.Context, deployedTriggerID string, externalUserID string) error
- func (c *Client) DeleteEndUser(ctx context.Context, externalUserID string) error
- func (c *Client) DeployTrigger(ctx context.Context, componentKey string, externalUserID string, ...) (*Trigger, error)
- func (c *Client) GetAccount(ctx context.Context, externalUserID string, app string, ...) (*GetAccountResponse, error)
- func (c *Client) GetComponent(ctx context.Context, componentKey string, componentType ComponentType) (*GetComponentResponse, error)
- func (c *Client) GetDeployedTrigger(ctx context.Context, deployedComponentID string, externalUserId string) (*Trigger, error)
- func (c *Client) GetPropOptions(ctx context.Context, propName string, componentKey string, ...) (*PropOptions, error)
- func (c *Client) InvokeAction(ctx context.Context, componentKey string, externalUserID string, ...) (map[string]any, error)
- func (c *Client) ListAccounts(ctx context.Context, externalUserID string, app string, oauthAppId string, ...) (*ListAccountsResponse, error)
- func (c *Client) ListComponents(ctx context.Context, componentType ComponentType, appName string, ...) (*ListComponentResponse, error)
- func (c *Client) ListDeployedTriggers(ctx context.Context, externalUserID string) (*TriggerList, error)
- func (c *Client) ListTriggerWebhooks(ctx context.Context, deployedComponentID string, externalUserID string) (*TriggerWebhookURLs, error)
- func (c *Client) Proxy(ctx context.Context, pr ProxyRequest) (*ProxyResponse, error)
- func (c *Client) ReloadComponentProps(ctx context.Context, componentType ComponentType, ...) (*ReloadComponentPropsResponse, error)
- func (c *Client) RetrieveTriggerEvents(ctx context.Context, deployedComponentID string, externalUserID string, ...) (*TriggerEventList, error)
- func (c *Client) RetrieveTriggerWorkflows(ctx context.Context, deployedComponentID string, externalUserID string) (*TriggerWorkflowIDs, error)
- func (c *Client) UpdateTriggerWebhooks(ctx context.Context, deployedComponentID string, externalUserID string, ...) (*TriggerWebhookURLs, error)
- func (c *Client) UpdateTriggerWorkflows(ctx context.Context, deployedComponentID string, externalUserID string, ...) (*TriggerWorkflowIDs, error)
- type Component
- type ComponentDetails
- type ComponentType
- type ConfigurableProp
- type ConfiguredProps
- type Credentials
- type DeployTriggerRequest
- type DeployTriggerResponse
- type DynamicProps
- type Event
- type GetAccountResponse
- type GetComponentResponse
- type GetTriggerResponse
- type InvokeActionRequest
- type ListAccountsResponse
- type ListComponentResponse
- type PageInfo
- type PropOptions
- type ProxyRequest
- type ProxyResponse
- type ReloadComponentPropsRequest
- type ReloadComponentPropsResponse
- type Trigger
- type TriggerEvent
- type TriggerEventList
- type TriggerList
- type TriggerWebhookURLs
- type TriggerWorkflowIDs
- type UpdateTriggerWebhooksRequest
- type UpdateTriggerWorkflowsRequest
- type UserTokenRequest
- type UserTokenResponse
- type Value
Constants ¶
This section is empty.
Variables ¶
var (
NotFoundErr error = errors.New("requested resource does not exist")
)
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
ExternalID string `json:"external_id,omitempty"`
Healthy bool `json:"healthy,omitempty"`
Dead bool `json:"dead,omitempty"`
App App `json:"app,omitzero"`
CreatedAt time.Time `json:"created_at,omitzero"`
UpdatedAt time.Time `json:"updated_at,omitzero"`
Credentials Credentials `json:"credentials,omitzero"`
ExpiresAt any `json:"expires_at,omitempty"`
Error any `json:"error,omitempty"`
LastRefreshedAt time.Time `json:"last_refreshed_at,omitzero"`
NextRefreshAt time.Time `json:"next_refresh_at,omitzero"`
}
type Client ¶
func (*Client) AcquireUserToken ¶
func (c *Client) AcquireUserToken( ctx context.Context, externalUserID string, webhookURI string, ) (*UserTokenResponse, error)
retrieve a short-lived token for that user
func (*Client) DeleteAccount ¶
DeleteAccount Delete a specific connected account for an end user, and any deployed triggers
func (*Client) DeleteAccounts ¶
DeleteAccounts Delete all connected accounts for a specific app
func (*Client) DeleteDeployedTrigger ¶
func (*Client) DeleteEndUser ¶
DeleteEndUser Delete an end user, all their connected accounts, and any deployed triggers.
func (*Client) DeployTrigger ¶
func (*Client) GetAccount ¶
func (c *Client) GetAccount( ctx context.Context, externalUserID string, app string, includeCredentials bool, accountId string, ) (*GetAccountResponse, error)
GetAccount Retrieve the account details for a specific account based on the account ID
func (*Client) GetComponent ¶
func (c *Client) GetComponent( ctx context.Context, componentKey string, componentType ComponentType, ) (*GetComponentResponse, error)
https://pipedream.com/docs/connect/api/#retrieve-a-component GetComponent retrieves a pipedream component and its configurable props
func (*Client) GetDeployedTrigger ¶
func (*Client) GetPropOptions ¶
func (c *Client) GetPropOptions( ctx context.Context, propName string, componentKey string, externalUserID string, configuredProps ConfiguredProps, ) (*PropOptions, error)
https://pipedream.com/docs/connect/api/#configure-a-component ConfigureComponent calls the configure endpoint for a component in pipedream externalUserID is the id defined by a third party or us component Key is the componentID propName is the key in the componentDetails
func (*Client) InvokeAction ¶
func (*Client) ListAccounts ¶
func (c *Client) ListAccounts( ctx context.Context, externalUserID string, app string, oauthAppId string, includeCredentials bool, ) (*ListAccountsResponse, error)
ListAccounts lists all accounts related to the currently set projectID All the parameters are optional
func (*Client) ListComponents ¶
func (c *Client) ListComponents( ctx context.Context, componentType ComponentType, appName string, searchTerm string, limit int, ) (*ListComponentResponse, error)
https://pipedream.com/docs/connect/api/#list-components ListComponents lists the components available in pipedream
func (*Client) ListDeployedTriggers ¶
func (*Client) ListTriggerWebhooks ¶
func (c *Client) ListTriggerWebhooks( ctx context.Context, deployedComponentID string, externalUserID string, ) (*TriggerWebhookURLs, error)
ListTriggerWebhooks Retrieve the list of webhook URLs listening to a deployed trigger
func (*Client) Proxy ¶
func (c *Client) Proxy( ctx context.Context, pr ProxyRequest, ) (*ProxyResponse, error)
Proxy posts to: POST /v1/connect/{project_id}/proxy https://pipedream.com/docs/connect/api-proxy
func (*Client) ReloadComponentProps ¶
func (c *Client) ReloadComponentProps( ctx context.Context, componentType ComponentType, configuredProps ConfiguredProps, externalUserID string, ComponentKey string, dynamicPropsID string, ) (*ReloadComponentPropsResponse, error)
ReloadComponentProps Reload the component’s props after configuring a dynamic prop, based on the current component’s configuration will use the component’s configuration to retrieve a new list of props depending on the value of the props that were configured so far
func (*Client) RetrieveTriggerEvents ¶
func (*Client) RetrieveTriggerWorkflows ¶
func (c *Client) RetrieveTriggerWorkflows( ctx context.Context, deployedComponentID string, externalUserID string, ) (*TriggerWorkflowIDs, error)
RetrieveTriggerWorkflows Retrieve the workflows listening to a deployed trigger
func (*Client) UpdateTriggerWebhooks ¶
func (c *Client) UpdateTriggerWebhooks( ctx context.Context, deployedComponentID string, externalUserID string, webhookURLs []string, ) (*TriggerWebhookURLs, error)
UpdateTriggerWebhooks Updates the list of webhook URLs that will listen to a deployed trigger
func (*Client) UpdateTriggerWorkflows ¶
func (c *Client) UpdateTriggerWorkflows( ctx context.Context, deployedComponentID string, externalUserID string, workflowIDs []string, ) (*TriggerWorkflowIDs, error)
UpdateTriggerWorkflows UUpdate the list of workflows that will listen to a deployed trigger
type Component ¶
type Component struct {
Key string `json:"key,omitempty"`
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
Type ComponentType `json:"type,omitempty"`
Description string `json:"description,omitempty"`
}
type ComponentDetails ¶
type ComponentDetails struct {
Component
ConfigurableProps []*ConfigurableProp `json:"configurable_props,omitempty"`
}
func (ComponentDetails) String ¶
func (c ComponentDetails) String() string
type ComponentType ¶
type ComponentType string
const ( Triggers ComponentType = "triggers" Actions ComponentType = "actions" Components ComponentType = "components" )
type ConfigurableProp ¶
type ConfigurableProp struct {
Name string `json:"name,omitempty"`
Type string `json:"type"`
App string `json:"app,omitempty"`
CustomResponse bool `json:"custom_response,omitempty"`
Label string `json:"label,omitempty"`
Description string `json:"description,omitempty"`
RemoteOptions *bool `json:"remoteOptions,omitempty"`
Options []any `json:"options,omitempty"` // this can be a string array or an object array of Value
UseQuery bool `json:"use_query,omitempty"`
Default any `json:"default,omitempty"`
Min int `json:"min,omitempty"`
Max int `json:"max,omitempty"`
Disabled bool `json:"disabled,omitempty"`
Secret bool `json:"secret,omitempty"`
Optional bool `json:"optional,omitempty"`
ReloadProps bool `json:"reloadProps,omitempty"`
}
func (ConfigurableProp) String ¶
func (c ConfigurableProp) String() string
type ConfiguredProps ¶
func (ConfiguredProps) String ¶
func (c ConfiguredProps) String() string
type Credentials ¶
type DeployTriggerRequest ¶
type DeployTriggerRequest struct {
ComponentKey string `json:"id"`
ConfiguredProps ConfiguredProps `json:"configured_props"`
ExternalUserID string `json:"external_user_id"`
WebhookURL string `json:"webhook_url,omitempty"`
WorkflowID string `json:"workflow_id,omitempty"`
DynamicPropsID string `json:"dynamic_props_id,omitempty"`
}
OPTIONAL: WorkflowID, DynamicPropsID and WebhookURL
type DeployTriggerResponse ¶
type DeployTriggerResponse struct {
Data Trigger `json:"data"`
}
type DynamicProps ¶
type DynamicProps struct {
ID string `json:"id,omitempty"`
ConfigurableProps []ConfigurableProp `json:"configurableProps,omitempty"`
}
type GetAccountResponse ¶
type GetAccountResponse struct {
Data Account `json:"data"`
}
type GetComponentResponse ¶
type GetComponentResponse struct {
Data *ComponentDetails `json:"data,omitempty"`
}
GetComponentResponse is the response for the get component endpoint
type GetTriggerResponse ¶
type GetTriggerResponse struct {
Data Trigger `json:"data"`
}
type InvokeActionRequest ¶
type InvokeActionRequest struct {
// ID is the ComponentID
ID string `json:"id,omitempty"`
ExternalUserID string `json:"external_user_id"`
ConfiguredProps ConfiguredProps `json:"configured_props,omitempty"`
DynamicPropsID string `json:"dynamic_props_id,omitempty"`
}
type ListAccountsResponse ¶
type ListComponentResponse ¶
type ListComponentResponse struct {
Data []*Component `json:"data,omitempty"`
}
ListComponentResponse is the response for the component list endpoint
type PropOptions ¶
type PropOptions struct {
Observations []any `json:"observations,omitempty"`
Context any `json:"context,omitempty"` // TODO
Options []Value `json:"options,omitempty"`
Errors []string `json:"errors,omitempty"`
StringOptions any `json:"string_options,omitempty"`
}
func (PropOptions) String ¶
func (p PropOptions) String() string
func (*PropOptions) UnmarshalJSON ¶
func (p *PropOptions) UnmarshalJSON(data []byte) error
type ProxyRequest ¶
type ProxyRequest struct {
ExternalUserID string `json:"external_user_id"`
AccountID string `json:"account_id"`
Method string `json:"method"`
URL string `json:"url"`
Headers http.Header `json:"headers,omitempty"`
Body json.RawMessage `json:"body,omitempty"`
}
func (*ProxyRequest) Validate ¶
func (pr *ProxyRequest) Validate() error
type ProxyResponse ¶
type ReloadComponentPropsRequest ¶
type ReloadComponentPropsRequest struct {
ExternalUserID string `json:"external_user_id,omitempty"`
ConfiguredProps ConfiguredProps `json:"configured_props,omitempty"`
ID string `json:"id,omitempty"`
DynamicPropsID string `json:"dynamic_props_id,omitempty"`
}
type ReloadComponentPropsResponse ¶
type ReloadComponentPropsResponse struct {
Observations []any `json:"observations,omitempty"`
Errors []string `json:"errors,omitempty"`
DynamicProps DynamicProps `json:"dynamicProps"`
}
type Trigger ¶
type Trigger struct {
ID string `json:"id"`
OwnerID string `json:"owner_id"`
ComponentID string `json:"component_id"`
ConfigurableProps []ConfigurableProp `json:"configurable_props,omitempty"`
ConfiguredProps ConfiguredProps `json:"configured_props,omitempty"`
Active bool `json:"active,omitempty"`
CreatedAt int `json:"created_at"`
UpdatedAt int `json:"updated_at"`
Name string `json:"name"`
NameSlug string `json:"name_slug"`
EmailAddress string `json:"email_address,omitempty"`
}
type TriggerEvent ¶
type TriggerEventList ¶
type TriggerEventList struct {
Data []TriggerEvent `json:"data,omitempty"`
}
type TriggerList ¶
type TriggerWebhookURLs ¶
type TriggerWebhookURLs struct {
WebhookURLs []string `json:"webhook_urls,omitempty"`
}
type TriggerWorkflowIDs ¶
type TriggerWorkflowIDs struct {
WorkflowIDs []string `json:"workflow_ids,omitempty"`
}
type UserTokenRequest ¶
type UserTokenRequest struct {
ExternalUserID string `json:"external_user_id"`
AllowedOrigins []string `json:"allowed_origins"`
SuccessRedirectURI string `json:"success_redirect_uri,omitempty"`
ErrorRedirectURI string `json:"error_redirect_uri,omitempty"`
WebhookURI string `json:"webhook_uri,omitempty"`
}