Documentation
¶
Overview ¶
Package client provides a wrapper for interacting with the DocuSign API.
API Endpoints Used ¶
This client interacts with the following DocuSign eSignature REST API v2.1 endpoints:
Users: DOCUMENTATION: https://developers.docusign.com/docs/esign-rest-api/reference/users/users/
- GET /restapi/v2.1/accounts/{accountId}/users - List account users (supports pagination)
- GET /restapi/v2.1/accounts/{accountId}/users/{userId} - Get user details
- POST /restapi/v2.1/accounts/{accountId}/users - Create new users
- PUT /restapi/v2.1/accounts/{accountId}/users/{userId}/profile - Update user profile
- DELETE /restapi/v2.1/accounts/{accountId}/users - Delete users
Groups: DOCUMENTATION: https://developers.docusign.com/docs/esign-rest-api/reference/usergroups/groups/ DOCUMENTATION: https://developers.docusign.com/docs/esign-rest-api/reference/usergroups/groupusers/
- GET /restapi/v2.1/accounts/{accountId}/groups - List account groups (supports pagination)
- GET /restapi/v2.1/accounts/{accountId}/groups/{groupId}/users - List users in a group (supports pagination)
- PUT /restapi/v2.1/accounts/{accountId}/groups/{groupId}/users - Add users to a group
- DELETE /restapi/v2.1/accounts/{accountId}/groups/{groupId}/users - Remove users from a group
Signing Groups: DOCUMENTATION: https://developers.docusign.com/docs/esign-rest-api/reference/signinggroups/
- GET /restapi/v2.1/accounts/{accountId}/signing_groups - List signing groups (supports pagination)
- GET /restapi/v2.1/accounts/{accountId}/signing_groups/{groupId}/users - List signing group users (supports pagination)
- PUT /restapi/v2.1/accounts/{accountId}/signing_groups/{groupId} - Update signing group membership
- DELETE /restapi/v2.1/accounts/{accountId}/signing_groups/{groupId}/users - Remove users from signing group
Permission Profiles: DOCUMENTATION: https://developers.docusign.com/docs/esign-rest-api/reference/accounts/accountpermissionprofiles/ DOCUMENTATION: https://developers.docusign.com/docs/esign-rest-api/reference/users/userprofiles/
- GET /restapi/v2.1/accounts/{accountId}/permission_profiles - List permission profiles (no pagination)
- PUT /restapi/v2.1/accounts/{accountId}/users/{userId}/profile - Update user profile
OAuth:
- GET https://account-d.docusign.com/oauth/userinfo - Get OAuth user info (demo environment)
- GET https://account.docusign.com/oauth/userinfo - Get OAuth user info (production environment)
API Documentation ¶
Complete API documentation: https://developers.docusign.com/docs/esign-rest-api/reference/
Pagination Strategy ¶
DocuSign API uses cursor-based pagination with the following parameters:
- count: Number of results per page (1-100, default: 100)
- start_position: Starting position (0-based index)
The API returns:
- endPosition: Last item position in current page
- totalSetSize: Total number of items available
Rate Limiting:
- API rate limits are enforced by DocuSign
- The SDK automatically handles rate limit errors via uhttp
Package client — DocuSign CLM (Contract Lifecycle Management) support.
CLM is a separate DocuSign product from eSignature, on a different host, with its own OAuth scopes ("spring_read"/"spring_write", see oauth.go) and a different Object API surface. Endpoints below follow DocuSign's CLM API reference; cmd/test-server mocks them. On the live tenant tested, a 401 "Access Denied" on every data call while account discovery succeeded was caused by the authorizing user lacking CLM admin rights.
API Endpoints Used ¶
Folders:
- GET /v2/{accountId}/folders/type?systemFolder=root - Get the root folder (GetRootFolder), the entry point for walking the folder tree. The same endpoint with the home, other sources and salesforce types finds those system folders (FindSystemFolder).
- GET /v2/{accountId}/folders/{id}/folders - List a folder's child folders (ListChildFolders).
- GET /v2/{accountId}/folders/{id}?expand=Security - Get a folder with its explicit security entries. Security is three separate collections by principal type (Groups/Roles/Users) - see ClmFolderSecurity's doc in clm_models.go.
- POST /v2/{accountId}/changesecuritytasks - Update folder security (grant: set an AccessType on the relevant Groups/Roles/Users entry; revoke: set that entry's AccessType to "NoAccess") — see PatchFolderSecurity's doc. Not the generic Folders PATCH, which accepts a Security field but silently ignores it.
Groups:
- GET /v2/{accountId}/groups - List CLM groups (GetAllGroups)
- GET /v2/{accountId}/groups/{id}/groupmembers - List a group's members (GetUsers)
Members (CLM's principal object):
- GET /v2/{accountId}/members - List members (GetMembers)
- GET /v2/{accountId}/members/{id}/groups - Groups a member belongs to
- GET /v2/{accountId}/members/{id}/workflowqueues - Workflow queues a member belongs to
- PATCH /v2/{accountId}/members/{id} - Add member to new groups (additive/merge)
- PUT /v2/{accountId}/members/{id} - Replace member's groups (adds new, removes unspecified)
PermissionSets:
- GET /v2/{accountId}/permissionsets - List permission sets (GetAll). Confirmed read-only: no assignment/grant endpoint exists anywhere in the CLM API.
Base URL resolution ¶
CLM's Object API base URL (a distinct host from eSignature's per-account base_uri, e.g. api.{site}.{region}.clm.docusign.net) is resolved via a separate account discovery call, confirmed via DocuSign's "CLM API 101" documentation:
GET https://auth.springcm.com/api/v2/{accountId}/account (production)
GET https://authuat.springcm.com/api/v2/{accountId}/account (demo/UAT)
authenticated with the same Bearer access token this connector already obtains via the unified eSignature OAuth flow (account.docusign.com/account-d.docusign.com) — no separate SpringCM-specific authentication is required to call it, per that same documentation. This is a different, legacy-hosted mechanism from both the token response and /oauth/userinfo: neither of those was confirmed to carry the CLM base URL (the token response's documented fields are access_token/token_type/ refresh_token/expires_in/scope; /oauth/userinfo's are sub/name/accounts[] with no CLM-specific field).
This endpoint's exact response schema was not available when this was written — only the endpoint, its auth requirement, and its stated purpose ("account related URLs including the base CLM API URLs") were confirmed. ensureClmInitialized below checks a short list of the most likely field names and fails with the actual response's field names listed if none match, rather than guessing wrong silently.
Pagination ¶
Offset-based: pageSortParams.offset / pageSortParams.limit / pageSortParams.sortProperty / pageSortParams.sortDirection / pageSortParams.filter query params; responses wrap results as {First, Href, Items, Last, Limit, Next, Offset, Previous, Total}.
Index ¶
- Constants
- Variables
- func ApplyQueryParam(reqURL *url.URL, key string, value string)
- func IDFromHref(href string) string
- func IsClmNoWorkflowTaskGroupsError(err error) bool
- type AccountInfo
- type AccountManagement
- type Client
- func (c *Client) CreateUsers(ctx context.Context, request CreateUsersRequest) (*UserCreationResponse, annotations.Annotations, error)
- func (c *Client) DeleteGroupUsers(ctx context.Context, groupID string, request GroupUsersRequest) (*GroupUsersResponse, annotations.Annotations, error)
- func (c *Client) DeleteSigningGroupUsers(ctx context.Context, signingGroupID string, request SigningGroupUsersRequest) (*SigningGroupUsersResponse, annotations.Annotations, error)
- func (c *Client) DeleteUsers(ctx context.Context, request DeleteUsersRequest) (*DeleteUsersResponse, annotations.Annotations, error)
- func (c *Client) EnsureClmReady(ctx context.Context) error
- func (c *Client) EnsureReady(ctx context.Context) error
- func (c *Client) FindSystemFolder(ctx context.Context, systemFolderType string) (*ClmFolder, annotations.Annotations, error)
- func (c *Client) GetFolder(ctx context.Context, folderID string, expand ...string) (*ClmFolder, annotations.Annotations, error)
- func (c *Client) GetFolderFresh(ctx context.Context, folderID string, expand ...string) (*ClmFolder, annotations.Annotations, error)
- func (c *Client) GetGroupMembers(ctx context.Context, groupID string, options PageOptions) ([]ClmMember, string, annotations.Annotations, error)
- func (c *Client) GetGroupUsers(ctx context.Context, groupId string, options PageOptions) ([]User, string, annotations.Annotations, error)
- func (c *Client) GetGroups(ctx context.Context, options PageOptions) ([]Group, string, annotations.Annotations, error)
- func (c *Client) GetMemberGroups(ctx context.Context, memberID string) ([]ClmGroup, annotations.Annotations, error)
- func (c *Client) GetMemberWorkflowQueues(ctx context.Context, memberID string) ([]ClmWorkflowQueue, annotations.Annotations, error)
- func (c *Client) GetPermissionProfiles(ctx context.Context) ([]PermissionProfile, annotations.Annotations, error)
- func (c *Client) GetPermissionProfilesFresh(ctx context.Context) ([]PermissionProfile, annotations.Annotations, error)
- func (c *Client) GetRootFolder(ctx context.Context) (*ClmFolder, annotations.Annotations, error)
- func (c *Client) GetSigningGroupUsers(ctx context.Context, groupId string, options PageOptions) ([]User, string, annotations.Annotations, error)
- func (c *Client) GetSigningGroups(ctx context.Context, options PageOptions) ([]SigningGroup, string, annotations.Annotations, error)
- func (c *Client) GetUserByEmail(ctx context.Context, userEmail string) (*User, annotations.Annotations, error)
- func (c *Client) GetUserDetails(ctx context.Context, userID string) (*UserDetail, annotations.Annotations, error)
- func (c *Client) GetUsers(ctx context.Context, options PageOptions) ([]User, string, annotations.Annotations, error)
- func (c *Client) GroupHref(ctx context.Context, groupID string) (string, error)
- func (c *Client) ListChildFolders(ctx context.Context, folderID string, options PageOptions) ([]*ClmFolder, string, annotations.Annotations, error)
- func (c *Client) ListGroups(ctx context.Context, options PageOptions) ([]ClmGroup, string, annotations.Annotations, error)
- func (c *Client) ListMembers(ctx context.Context, options PageOptions) ([]ClmMember, string, annotations.Annotations, error)
- func (c *Client) ListPermissionSets(ctx context.Context, options PageOptions) ([]ClmPermissionSet, string, annotations.Annotations, error)
- func (c *Client) MemberHref(ctx context.Context, memberID string) (string, error)
- func (c *Client) PatchFolderSecurity(ctx context.Context, folderID string, write ClmFolderSecurityWrite) (annotations.Annotations, error)
- func (c *Client) PatchMemberGroups(ctx context.Context, memberID string, newGroups []ClmGroup) (annotations.Annotations, error)
- func (c *Client) PutMemberGroups(ctx context.Context, memberID string, fullGroups []ClmGroup) (annotations.Annotations, error)
- func (c *Client) RequestRefreshToken(ctx context.Context, clientID, clientSecret, redirectURI, code string) (string, error)
- func (c *Client) UpdateGroupUsers(ctx context.Context, groupID string, request GroupUsersRequest) (*GroupUsersResponse, annotations.Annotations, error)
- func (c *Client) UpdateSigningGroup(ctx context.Context, signingGroupID string, request SigningGroupUsersRequest) (*SigningGroupUsersResponse, annotations.Annotations, error)
- func (c *Client) UpdateUserProfile(ctx context.Context, userID string, request UpdateUserProfileRequest) (annotations.Annotations, error)
- type ClmAPIError
- type ClmChangeSecurityTaskFolder
- type ClmChangeSecurityTaskRequest
- type ClmChangeSecurityTaskResponse
- type ClmErrorResponse
- type ClmFolder
- type ClmFolderPage
- type ClmFolderRef
- type ClmFolderSecurity
- type ClmFolderSecurityWrite
- type ClmGroup
- type ClmGroupList
- type ClmGroupPage
- type ClmGroupSecurityEntry
- type ClmMember
- type ClmMemberGroupsPatch
- type ClmMemberPage
- type ClmPage
- type ClmPermissionSet
- type ClmPermissionSetPage
- type ClmRole
- type ClmRoleSecurityEntry
- type ClmUserSecurityEntry
- type ClmWorkflowQueue
- type ClmWorkflowQueuePage
- type CreateUsersRequest
- type DeleteUsersRequest
- type DeleteUsersResponse
- type EmailNotifications
- type ErrorResponse
- type Group
- type GroupUserIdentifier
- type GroupUsersRequest
- type GroupUsersResponse
- type GroupsResponse
- type NewUser
- type OAuth2Docusign
- type Page
- type PageOptions
- type PermissionProfile
- type PermissionProfilesResponse
- type SigningGroup
- type SigningGroupResponse
- type SigningGroupUser
- type SigningGroupUserIdentifier
- type SigningGroupUsersRequest
- type SigningGroupUsersResponse
- type TokenResponse
- type UpdateUserProfileRequest
- type User
- type UserCreationResponse
- type UserDetail
- type UserIdentifier
- type UserInfoResponse
- type UserSettings
- type UsersResponse
Constants ¶
const ( ClmChangeSecurityStatusSuccess = "success" ClmChangeSecurityStatusWaiting = "waiting" ClmChangeSecurityStatusFailure = "failure" ClmChangeSecurityStatusProcessing = "processing" )
ClmChangeSecurityStatus* are ChangeSecurityTasks' documented (lowercase) Status values. See PatchFolderSecurity's doc.
const ( ClmAccessTypeInherit = "InheritFromParentFolder" ClmAccessTypeNoAccess = "NoAccess" ClmAccessTypeView = "View" ClmAccessTypeViewCreate = "ViewCreate" ClmAccessTypeViewEdit = "ViewEdit" ClmAccessTypeViewEditDelete = "ViewEditDelete" ClmAccessTypeViewEditDeleteSetAccess = "ViewEditDeleteSetAccess" ClmAccessTypeCustom = "Custom" )
ClmAccessType enumerates the confirmed folder-security write values. Custom and InheritFromParentFolder are deliberately not exposed as grantable entitlements — see pkg/connector/clm_folders.go.
const ClmDiscoveryFieldAPIBaseURL = "ApiBaseUrl"
clmBaseURLCandidateFields lists the response field names most likely to carry the CLM Object API base URL, in priority order. ClmDiscoveryFieldAPIBaseURL mirrors the field name CLM's legacy token-exchange response uses for the same concept, per the CLM.CM OAuth 2.0 Web Server Flow documentation — exported so clmtest's mock can use the identical constant rather than a duplicated literal. Deliberately excludes generic names like "BaseUrl"/"base_url": the discovery response's exact schema isn't confirmed, and a bare "BaseUrl" is plausible enough as a name for an unrelated field (e.g. a web/UI URL) that matching it could silently misroute every CLM API call at the wrong host instead of failing loudly the way an absent field does.
const DefaultPageSize = 100
Variables ¶
var ClmChangeSecurityTaskPollInterval = 2 * time.Second
ClmChangeSecurityTaskPollInterval is how long PatchFolderSecurity waits between polls of a "waiting"/"processing" ChangeSecurityTasks task. Exported so tests can shorten it.
var ClmRoles = []ClmRole{
{Name: "Guest"},
{Name: "LimitedSubscriber"},
{Name: "FullSubscriber"},
{Name: "UserAdministrator"},
{Name: "SuperAdministrator"},
}
ClmRoles are the Member.Role values the CLM API reference lists; clm_role always syncs them.
Functions ¶
func ApplyQueryParam ¶ added in v0.0.3
func IDFromHref ¶ added in v0.1.9
IDFromHref extracts the trailing path segment from a CLM object's Href — CLM's Object API schemas expose a Href field ("Uri where the object can be retrieved") but no separate opaque Id field, so this is the closest thing to a native ID CLM exposes. Shared by pkg/connector (reading real Hrefs) and pkg/client/clmtest (generating seed Hrefs for the mock server), which otherwise each maintained an identical copy.
func IsClmNoWorkflowTaskGroupsError ¶ added in v0.2.1
IsClmNoWorkflowTaskGroupsError reports whether err from GET .../members/{id}/workflowqueues is a 404 with ErrorCode 104 ("Workflow task groups not found or you do not have access"). A production sync showed CLM answering this way, not with a 200 and an empty Items list, for members in no workflow task group. The same response also covers "no access", and CLM offers no way to tell the two apart; the connector assumes a caller that can list members can also read their workflow queues, so callers treat a match as "no task groups" (see the README's CLM section). A 404 without ErrorCode 104 and every 401/403 don't match.
Types ¶
type AccountInfo ¶ added in v0.0.6
type AccountInfo struct {
AccountId string `json:"account_id"`
IsDefault bool `json:"is_default"`
AccountName string `json:"account_name"`
BaseURI string `json:"base_uri"`
OrganizationId string `json:"organization_id"`
}
AccountInfo represents account information from the User Info response.
type AccountManagement ¶
type AccountManagement struct {
CanManageUsers string `json:"canManageUsers"`
CanManageAdmins string `json:"canManageAdmins"`
CanManageAccountSettings string `json:"canManageAccountSettings"`
CanManageReporting string `json:"canManageReporting"`
CanManageAccountSecuritySettings string `json:"canManageAccountSecuritySettings"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps HTTP interactions with the DocuSign API.
func New ¶
func New( ctx context.Context, isDemo bool, clientID, clientSecret, redirectURI, refreshToken, configAccountId string, includeClm bool, clmBaseURLOverride, baseURLOverride string, ) (*Client, error)
New constructs a Client with OAuth2 flow, now using dynamic base URI resolution. If configAccountId is non-empty, the client will select that specific account instead of the default. includeClm requests the additional OAuth scopes required for the DocuSign CLM API. clmBaseURLOverride and baseURLOverride are testing-only; see their Client field docs. When baseURLOverride is set, the real OAuth refresh flow is skipped entirely and refreshToken is used verbatim as a static bearer token — there's no real account to refresh a token against once eSignature calls are redirected to a local mock.
func NewClient ¶
func NewClient(ctx context.Context, isDemo bool, tokenSource oauth2.TokenSource, configAccountId, clmBaseURLOverride string, httpClient ...*uhttp.BaseHttpClient) *Client
NewClient initializes a Client with a fixed token and optional HTTP wrapper. If configAccountId is non-empty, the client will select that specific account instead of the default. clmBaseURLOverride is testing-only; see the Client.clmBaseURLOverride field doc — used by the service-mode path (NewWithTokenSource), where DocuSign auth is handled by ConductorOne's managed OAuth app rather than a local refresh token.
func (*Client) CreateUsers ¶
func (c *Client) CreateUsers(ctx context.Context, request CreateUsersRequest) (*UserCreationResponse, annotations.Annotations, error)
CreateUsers sends a bulk create request for new users in the account.
func (*Client) DeleteGroupUsers ¶ added in v0.1.1
func (c *Client) DeleteGroupUsers(ctx context.Context, groupID string, request GroupUsersRequest) (*GroupUsersResponse, annotations.Annotations, error)
DeleteGroupUsers removes users from a group using the DocuSign API. Based on API: DELETE /restapi/v2.1/accounts/{accountId}/groups/{groupId}/users.
func (*Client) DeleteSigningGroupUsers ¶ added in v0.1.1
func (c *Client) DeleteSigningGroupUsers(ctx context.Context, signingGroupID string, request SigningGroupUsersRequest) (*SigningGroupUsersResponse, annotations.Annotations, error)
DeleteSigningGroupUsers removes users from a signing group using the DocuSign API. Based on API: DELETE /restapi/v2.1/accounts/{accountId}/signing_groups/{signingGroupId}/users.
func (*Client) DeleteUsers ¶ added in v0.1.1
func (c *Client) DeleteUsers(ctx context.Context, request DeleteUsersRequest) (*DeleteUsersResponse, annotations.Annotations, error)
DeleteUsers sends a bulk delete request to remove users from the account.
func (*Client) EnsureClmReady ¶ added in v0.1.9
EnsureClmReady exposes the CLM-readiness check every other CLM client method runs internally before its real request, for callers with no CLM endpoint of their own that still need to detect CLM availability — namely Connector.Validate() (see pkg/connector/connector.go), which runs this once, up front, before any CLM builder's List() executes. Memoized after the first successful call, same as every other CLM method — see ensureClmInitialized.
func (*Client) EnsureReady ¶ added in v0.1.9
EnsureReady exposes the base eSignature-credential check every other client method runs internally before its real request, for callers with no eSignature endpoint of their own that still need to detect whether the base connection/credentials are valid — namely Connector.Validate() (see pkg/connector/connector.go), which runs this once, up front, before any resource type's List() executes. Memoized after the first successful call, same as every other method — see ensureInitialized.
func (*Client) FindSystemFolder ¶
func (c *Client) FindSystemFolder(ctx context.Context, systemFolderType string) (*ClmFolder, annotations.Annotations, error)
FindSystemFolder fetches a system folder by type, with its ParentFolder. It returns a nil folder only on a 404 with CLM ErrorCode 108 (Invalid System Folder); any other error, a 404 with another code included, fails the sync: CLM answers 404 both for a missing object and for one the caller can't see. Doc URL: https://developers.docusign.com/docs/clm-api/reference/objects/folders/getbysystemtype/
func (*Client) GetFolder ¶ added in v0.1.8
func (c *Client) GetFolder(ctx context.Context, folderID string, expand ...string) (*ClmFolder, annotations.Annotations, error)
GetFolder fetches a single folder, optionally expanding Security to get its explicit (non-inherited) folder security entries. The response may be served from the shared HTTP GET cache. A 404 fails the sync, because CLM answers 404 both for a missing object and for one the caller can't see.
func (*Client) GetFolderFresh ¶ added in v0.1.8
func (c *Client) GetFolderFresh(ctx context.Context, folderID string, expand ...string) (*ClmFolder, annotations.Annotations, error)
GetFolderFresh is identical to GetFolder but bypasses the shared HTTP GET cache. Use this for the read-before-write check in Grant/Revoke: PatchFolderSecurity doesn't invalidate the cache entry a prior GetFolder call may have left behind, so a cached read there would see security entries as they stood before the most recent write rather than the current state.
func (*Client) GetGroupMembers ¶ added in v0.1.8
func (c *Client) GetGroupMembers(ctx context.Context, groupID string, options PageOptions) ([]ClmMember, string, annotations.Annotations, error)
GetGroupMembers lists the members of a CLM group.
Pagination: offset/limit, see package doc.
func (*Client) GetGroupUsers ¶
func (c *Client) GetGroupUsers(ctx context.Context, groupId string, options PageOptions) ([]User, string, annotations.Annotations, error)
GetGroupUsers fetches a page of users that belong to a specific group.
Pagination: This endpoint supports cursor-based pagination using start_position and count parameters. The API returns up to 100 users per page (controlled by PageOptions.PageSize). To fetch the next page, use the returned nextToken as PageOptions.PageToken.
Returns: users list, next page token (empty if last page), annotations, error.
func (*Client) GetGroups ¶
func (c *Client) GetGroups(ctx context.Context, options PageOptions) ([]Group, string, annotations.Annotations, error)
GetGroups fetches a page of groups from the DocuSign account.
Pagination: This endpoint supports cursor-based pagination using start_position and count parameters. The API returns up to 100 groups per page (controlled by PageOptions.PageSize). To fetch the next page, use the returned nextToken as PageOptions.PageToken.
Returns: groups list, next page token (empty if last page), annotations, error.
func (*Client) GetMemberGroups ¶ added in v0.1.8
func (c *Client) GetMemberGroups(ctx context.Context, memberID string) ([]ClmGroup, annotations.Annotations, error)
GetMemberGroups gets the FULL current list of groups a member belongs to — required before Grant/Revoke, since both are read-modify-write against this list (Patch is additive/merge, Put is full-replace). This method pages to completion internally: callers need the complete list, not one page of it — Revoke in particular does a full-replace Put using this result, so a truncated list here would silently drop the member's memberships in every group beyond the first page.
Intentional carve-out from the usual client-layer rule against looping through pages internally (that's normally the connector layer's job, driving one page per call): this isn't a sync List — it's a read-before-write for provisioning, where the caller fundamentally needs the complete set to safely do a full-replace Put, not a page at a time. See clmPageToCompletion for the shared bounded/non-advancing-token-guarded loop.
func (*Client) GetMemberWorkflowQueues ¶ added in v0.1.9
func (c *Client) GetMemberWorkflowQueues(ctx context.Context, memberID string) ([]ClmWorkflowQueue, annotations.Annotations, error)
GetMemberWorkflowQueues lists the workflow queues a CLM member belongs to. Like GetMemberGroups, this fetches the member's complete set rather than exposing a page token: clm_workflow_queue's List() (pkg/connector/clm_workflow_queues.go) needs the complete set for the member it was called with, not one page at a time. Confirmed read-only intent per the API's documented surface: there is no reverse lookup (queue to members) and no membership grant/revoke endpoint, only work-item assign/unassign — which this connector doesn't sync (see clm_workflow_queues.go).
func (*Client) GetPermissionProfiles ¶ added in v0.0.3
func (c *Client) GetPermissionProfiles(ctx context.Context) ([]PermissionProfile, annotations.Annotations, error)
GetPermissionProfiles fetches all permission profiles from the DocuSign account. The response may be served from the shared HTTP GET cache — fine for List/Revoke, neither of which memoizes across syncs the way userBuilder does (see GetPermissionProfilesFresh).
Cache-split skew (accepted tradeoff, not an oversight): this cache is uhttp's own shared GET cache, which is cross-sync for a long-lived connector process (default TTL 1h, overridable via BATON_HTTP_CACHE_TTL) — not just cross-caller within one sync. A permission profile created or deleted between two syncs less than that TTL apart can be visible to userBuilder's always-fresh GetPermissionProfilesFresh grants pass before it is visible here, or vice versa, producing a bounded resource-vs-grant skew window (up to the cache TTL) between what List/Revoke see and what the grants pass sees. Pre-split, both readers shared this same cached view, so there was no skew between them — this split introduced the asymmetry, in exchange for keeping List/Revoke on uhttp's cheap shared cache path instead of paying for a fresh call on every read. That tradeoff is intentional: bypassing the cache here too would undo the call-volume reduction this split exists for.
Pagination: This endpoint does NOT support pagination. It returns all permission profiles in a single request. Typically, DocuSign accounts have a limited number of permission profiles (< 50), so this is acceptable.
Returns: all permission profiles, annotations, error.
func (*Client) GetPermissionProfilesFresh ¶ added in v0.1.9
func (c *Client) GetPermissionProfilesFresh(ctx context.Context) ([]PermissionProfile, annotations.Annotations, error)
GetPermissionProfilesFresh is identical to GetPermissionProfiles but bypasses the shared HTTP GET cache. userBuilder calls this at most once per sync (see its memoization fields' doc in pkg/connector/users.go), so by the time this request fires, that caller has already decided a fresh call is needed — a cached response here could only ever serve a stale snapshot left over from a previous sync on the same long-lived connector process, never save a real call. List and Revoke don't share userBuilder's process-lifetime memoization risk (neither memoizes this call across syncs), and sharing uhttp's cache with them when both fire in the same sync saves a real network call — so only this path opts out of the cache, not GetPermissionProfiles itself.
This does NOT mean List/Revoke are free of cross-sync staleness risk of their own: see GetPermissionProfiles' doc for the cache-split skew this asymmetry introduces between this method's always-fresh view and List/Revoke's cached one — an accepted, bounded tradeoff, not a gap specific to this method.
func (*Client) GetRootFolder ¶
func (c *Client) GetRootFolder(ctx context.Context) (*ClmFolder, annotations.Annotations, error)
GetRootFolder fetches the account's root folder, the entry point for walking the folder tree with ListChildFolders. Doc URL: https://developers.docusign.com/docs/clm-api/reference/objects/folders/getbysystemtype/
func (*Client) GetSigningGroupUsers ¶ added in v0.0.3
func (c *Client) GetSigningGroupUsers(ctx context.Context, groupId string, options PageOptions) ([]User, string, annotations.Annotations, error)
GetSigningGroupUsers fetches a page of users that belong to a specific signing group.
Pagination: This endpoint supports cursor-based pagination using start_position and count parameters. The API returns up to 100 users per page (controlled by PageOptions.PageSize). To fetch the next page, use the returned nextToken as PageOptions.PageToken.
Returns: users list, next page token (empty if last page), annotations, error.
func (*Client) GetSigningGroups ¶ added in v0.0.3
func (c *Client) GetSigningGroups(ctx context.Context, options PageOptions) ([]SigningGroup, string, annotations.Annotations, error)
GetSigningGroups fetches a page of signing groups from the DocuSign account.
Pagination: This endpoint supports cursor-based pagination using start_position and count parameters. The API returns up to 100 signing groups per page (controlled by PageOptions.PageSize). To fetch the next page, use the returned nextToken as PageOptions.PageToken.
Returns: signing groups list, next page token (empty if last page), annotations, error.
func (*Client) GetUserByEmail ¶ added in v0.0.3
func (c *Client) GetUserByEmail(ctx context.Context, userEmail string) (*User, annotations.Annotations, error)
GetUserByEmail retrieves a user filtering by the email and the user status 'Active' or 'Activation Sent'.
func (*Client) GetUserDetails ¶
func (c *Client) GetUserDetails(ctx context.Context, userID string) (*UserDetail, annotations.Annotations, error)
GetUserDetails fetches detailed information for a specific user, including permissions.
func (*Client) GetUsers ¶
func (c *Client) GetUsers(ctx context.Context, options PageOptions) ([]User, string, annotations.Annotations, error)
GetUsers fetches a page of users from the DocuSign account.
Pagination: This endpoint supports cursor-based pagination using start_position and count parameters. The API returns up to 100 users per page (controlled by PageOptions.PageSize). To fetch the next page, use the returned nextToken as PageOptions.PageToken.
Returns: users list, next page token (empty if last page), annotations, error.
func (*Client) GroupHref ¶ added in v0.1.9
GroupHref builds a CLM group's Href from its native ID — see hrefFor's doc.
func (*Client) ListChildFolders ¶
func (c *Client) ListChildFolders(ctx context.Context, folderID string, options PageOptions) ([]*ClmFolder, string, annotations.Annotations, error)
ListChildFolders lists the direct child folders of a CLM folder. Doc URL: https://developers.docusign.com/docs/clm-api/reference/objects/folders/getchildfolders/
A 404 fails the sync, because CLM answers 404 both for a missing object and for one the caller can't see.
Pagination: offset/limit, see package doc. CLM caps a collection page at 100 items.
func (*Client) ListGroups ¶ added in v0.1.8
func (c *Client) ListGroups(ctx context.Context, options PageOptions) ([]ClmGroup, string, annotations.Annotations, error)
ListGroups lists CLM groups (a distinct object from eSignature groups).
Pagination: offset/limit, see package doc.
func (*Client) ListMembers ¶ added in v0.1.8
func (c *Client) ListMembers(ctx context.Context, options PageOptions) ([]ClmMember, string, annotations.Annotations, error)
ListMembers lists CLM members (the CLM API's principal object). Synced as its own resource type rather than reused as the existing `user` resource, since identity between the two could not be confirmed 1:1.
Pagination: offset/limit, see package doc.
func (*Client) ListPermissionSets ¶ added in v0.1.8
func (c *Client) ListPermissionSets(ctx context.Context, options PageOptions) ([]ClmPermissionSet, string, annotations.Annotations, error)
ListPermissionSets lists CLM permission sets. Confirmed read-only — no grant/revoke/assignment endpoint exists anywhere in the CLM API for this object.
Pagination: offset/limit, see package doc.
func (*Client) MemberHref ¶ added in v0.1.9
MemberHref builds a CLM member's Href from its native ID — see hrefFor's doc.
func (*Client) PatchFolderSecurity ¶ added in v0.1.8
func (c *Client) PatchFolderSecurity(ctx context.Context, folderID string, write ClmFolderSecurityWrite) (annotations.Annotations, error)
PatchFolderSecurity grants or revokes folder security. write must be the folder's complete security state across all three principal-type collections (see the connector-layer caller — clmFolderSecurityToWrite builds this from a fresh read, with one entry changed/added in whichever of Groups/Roles/Users the grant/revoke targets), not just the one entry being changed: ChangeSecurityTasks' merge-vs-replace semantics for the Security field are undocumented, and sending the complete state is correct under either interpretation, whereas sending only the one changed entry would wipe every other principal's access to the folder if the real API replaces rather than merges.
Sets a folder's security via CLM's ChangeSecurityTasks async Task API; the generic PATCH /v2/{accountId}/folders/{id} returns 200 but silently ignores a Security payload.
The request body is ClmChangeSecurityTaskRequest, see its doc for the documented schema: https://developers.docusign.com/docs/clm-api/reference/tasks/changesecuritytasks/post/ Status values are documented in lowercase (success/waiting/failure/processing).
func (*Client) PatchMemberGroups ¶ added in v0.1.8
func (c *Client) PatchMemberGroups(ctx context.Context, memberID string, newGroups []ClmGroup) (annotations.Annotations, error)
PatchMemberGroups grants group membership: the CLM API adds the member to any group in newGroups they don't already belong to and leaves the rest of their membership untouched (additive/merge — confirmed via the CLM API's own Patch description: "the member will be added to any new groups provided"). Since the merge happens API-side, callers may pass either just the group(s) being added or their full current list plus the addition — both are safe. This connector's only caller passes the full list.
func (*Client) PutMemberGroups ¶ added in v0.1.8
func (c *Client) PutMemberGroups(ctx context.Context, memberID string, fullGroups []ClmGroup) (annotations.Annotations, error)
PutMemberGroups revokes group membership: replaces the member's full group list with fullGroups (any group omitted from this list is removed — confirmed via the CLM API's own Put description: "added to any new groups provided and removed from unspecified groups"). Callers must pass the member's CURRENT groups minus the one(s) being revoked, not just the groups to add — this is a full-replace, not a diff.
func (*Client) RequestRefreshToken ¶ added in v0.1.2
func (c *Client) RequestRefreshToken(ctx context.Context, clientID, clientSecret, redirectURI, code string) (string, error)
RequestRefreshToken exchanges an authorization code for a refresh token. DocuSign requires Basic Auth (base64(clientID:clientSecret)) and redirect_uri in the request.
func (*Client) UpdateGroupUsers ¶ added in v0.1.1
func (c *Client) UpdateGroupUsers(ctx context.Context, groupID string, request GroupUsersRequest) (*GroupUsersResponse, annotations.Annotations, error)
UpdateGroupUsers adds users to a group using the DocuSign API. Based on API: PUT /restapi/v2.1/accounts/{accountId}/groups/{groupId}/users.
func (*Client) UpdateSigningGroup ¶ added in v0.1.1
func (c *Client) UpdateSigningGroup(ctx context.Context, signingGroupID string, request SigningGroupUsersRequest) (*SigningGroupUsersResponse, annotations.Annotations, error)
UpdateSigningGroup updates a signing group by adding users to it. Based on API: PUT /restapi/v2.1/accounts/{accountId}/signing_groups/{signingGroupId}.
func (*Client) UpdateUserProfile ¶ added in v0.1.1
func (c *Client) UpdateUserProfile(ctx context.Context, userID string, request UpdateUserProfileRequest) (annotations.Annotations, error)
UpdateUserProfile updates a user's permission profile. Based on API: PUT /restapi/v2.1/accounts/{accountId}/users/{userId}/profile.
type ClmAPIError ¶ added in v0.2.1
type ClmAPIError struct {
ErrorCode int
// contains filtered or unexported fields
}
ClmAPIError wraps a failed CLM request's error with the ErrorCode CLM returned in its error envelope. Error() and Unwrap() defer to the wrapped error, so the message and the gRPC code (status.Code) are unchanged; only errors.As callers see ErrorCode.
func (*ClmAPIError) Error ¶ added in v0.2.1
func (e *ClmAPIError) Error() string
func (*ClmAPIError) Unwrap ¶ added in v0.2.1
func (e *ClmAPIError) Unwrap() error
type ClmChangeSecurityTaskFolder ¶ added in v0.1.9
type ClmChangeSecurityTaskFolder struct {
Href string `json:"Href"`
Security ClmFolderSecurityWrite `json:"Security"`
}
ClmChangeSecurityTaskFolder is the minimal Folder reference ChangeSecurityTasks' POST needs: which folder (Href) and what to set its security to (Security) — see ClmChangeSecurityTaskRequest's doc. The real Folder object has many more fields (Name, ParentFolder, Path, etc.); none are required here, mirroring how ParentFolder references elsewhere in this API only ever need Href.
type ClmChangeSecurityTaskRequest ¶ added in v0.1.9
type ClmChangeSecurityTaskRequest struct {
Folder ClmChangeSecurityTaskFolder `json:"Folder"`
}
ClmChangeSecurityTaskRequest is the request body for POST .../changesecuritytasks. It sends Href and Security inside Folder; the schema also lists both at the task level, with no example: https://developers.docusign.com/docs/clm-api/reference/tasks/changesecuritytasks/post/
type ClmChangeSecurityTaskResponse ¶ added in v0.1.9
type ClmChangeSecurityTaskResponse struct {
Href string `json:"Href"`
Status string `json:"Status"`
}
ClmChangeSecurityTaskResponse is CLM's ChangeSecurityTasks response envelope. The documented "Task.ChangeSecurityTask" schema also lists top-level Folder and Security fields alongside Href/Status, but PatchFolderSecurity only needs Status to decide success/failure; Href is this task's own poll URL, echoed back from the create call. Status is lowercase, see PatchFolderSecurity's doc in clm_client.go. Documented shape: https://developers.docusign.com/docs/clm-api/reference/tasks/changesecuritytasks/post/
type ClmErrorResponse ¶ added in v0.1.8
type ClmErrorResponse struct {
Error struct {
UserMessage string `json:"UserMessage"`
DeveloperMessage string `json:"DeveloperMessage"`
ErrorCode int `json:"ErrorCode"`
ReferenceId string `json:"ReferenceId"`
} `json:"Error"`
}
ClmErrorResponse is CLM's error envelope — confirmed via a live 401 from a real CLM tenant: {"Error":{"HttpStatusCode":401,"UserMessage":"Access Denied", "DeveloperMessage":"Access Denied","ErrorCode":103,"ReferenceId":"..."}}. Errors are nested under "Error", not a top-level "Message" field.
func (*ClmErrorResponse) Message ¶ added in v0.1.8
func (e *ClmErrorResponse) Message() string
Message renders the CLM error envelope, ErrorCode and ReferenceId included; with neither UserMessage nor DeveloperMessage it returns a generic message.
type ClmFolder ¶ added in v0.1.8
type ClmFolder struct {
Href string `json:"Href"`
Name string `json:"Name"`
Description string `json:"Description"`
Path string `json:"Path"`
CreatedBy string `json:"CreatedBy"`
CreatedDate string `json:"CreatedDate"`
UpdatedBy string `json:"UpdatedBy"`
UpdatedDate string `json:"UpdatedDate"`
ParentFolder *ClmFolderRef `json:"ParentFolder,omitempty"`
PropagateAttributeGroupsToChildren bool `json:"PropagateAttributeGroupsToChildren,omitempty"`
// Security is only populated when the request used ?expand=Security, and only
// reflects explicit assignments — not permissions inherited from a parent folder.
Security ClmFolderSecurity `json:"Security,omitempty"`
}
ClmFolder represents a CLM Folder object.
type ClmFolderPage ¶ added in v0.1.8
ClmFolderPage is the paginated collection of ClmFolder (e.g. a folder's child folders).
type ClmFolderRef ¶ added in v0.1.8
ClmFolderRef is a lightweight folder reference (e.g. ParentFolder).
type ClmFolderSecurity ¶ added in v0.1.8
type ClmFolderSecurity struct {
Groups []ClmGroupSecurityEntry `json:"Groups,omitempty"`
Roles []ClmRoleSecurityEntry `json:"Roles,omitempty"`
Users []ClmUserSecurityEntry `json:"Users,omitempty"`
}
ClmFolderSecurity is a folder's explicit (non-inherited) security assignments, as GetFolder?expand=Security returns them live: three flat arrays by principal type, with no pagination envelope, unlike other CLM lists.
type ClmFolderSecurityWrite ¶ added in v0.1.8
type ClmFolderSecurityWrite struct {
Groups []ClmGroupSecurityEntry `json:"Groups,omitempty"`
Roles []ClmRoleSecurityEntry `json:"Roles,omitempty"`
Users []ClmUserSecurityEntry `json:"Users,omitempty"`
}
ClmFolderSecurityWrite is the plain-list (non-paginated) shape of ClmFolderSecurity used on writes — a write payload has no First/Href/Last/Limit/Next/Offset/Previous/ Total metadata to send, mirroring ClmGroupList's precedent for the same reason on member-groups writes. Grant/Revoke always populate all three fields with the folder's complete current security (see clm_folders.go's clmFolderSecurityToWrite), not just the one changed entry: ChangeSecurityTasks' merge-vs-replace semantics for Security are undocumented, and sending the complete state is correct either way.
Entries serialize via ClmGroupSecurityEntry/ClmUserSecurityEntry's MarshalJSON, so a write sends the same {Item: {...}, AccessType} shape the read side decodes. It is sent through ChangeSecurityTasks (see PatchFolderSecurity's doc), not the generic Folders Patch.
type ClmGroup ¶ added in v0.1.8
type ClmGroup struct {
Href string `json:"Href"`
Name string `json:"Name"`
Description string `json:"Description,omitempty"`
// GroupType is "security" or "distribution" per the confirmed schema.
GroupType string `json:"GroupType,omitempty"`
CreatedDate string `json:"CreatedDate,omitempty"`
UpdatedDate string `json:"UpdatedDate,omitempty"`
}
ClmGroup represents a CLM Group object — distinct from eSignature's Group.
type ClmGroupList ¶ added in v0.1.8
type ClmGroupList struct {
Items []ClmGroup `json:"Items"`
}
ClmGroupList is a bare list of groups, used for write payloads (see ClmMemberGroupsPatch).
type ClmGroupPage ¶ added in v0.1.8
ClmGroupPage is the paginated collection of ClmGroup, returned by read endpoints (GetAllGroups, a member's current groups, etc.). See ClmGroupList for the separate, leaner type used on write payloads.
type ClmGroupSecurityEntry ¶ added in v0.1.8
type ClmGroupSecurityEntry struct {
AccessType string
Href string
Name string
GroupType string
Description string
CreatedDate string
UpdatedDate string
}
ClmGroupSecurityEntry is one folder-security grant to a CLM Group. Live, the wire shape nests the group's fields under "Item", sibling to AccessType ({"Item": {"Href":..., "Name":...}, "AccessType":"View"}); custom (Un)MarshalJSON keeps the Go struct flat.
func (ClmGroupSecurityEntry) MarshalJSON ¶ added in v0.1.9
func (e ClmGroupSecurityEntry) MarshalJSON() ([]byte, error)
func (*ClmGroupSecurityEntry) UnmarshalJSON ¶ added in v0.1.9
func (e *ClmGroupSecurityEntry) UnmarshalJSON(data []byte) error
type ClmMember ¶ added in v0.1.8
type ClmMember struct {
Href string `json:"Href"`
Email string `json:"Email"`
UserName string `json:"UserName"`
FirstName string `json:"FirstName"`
LastName string `json:"LastName"`
MiddleName string `json:"MiddleName,omitempty"`
// Role is the member's CLM role; accounts can return values beyond ClmRoles (e.g. CLMAdmin).
Role string `json:"Role"`
Company string `json:"Company,omitempty"`
Department string `json:"Department,omitempty"`
Title string `json:"Title,omitempty"`
CreatedDate string `json:"CreatedDate,omitempty"`
UpdatedDate string `json:"UpdatedDate,omitempty"`
ExemptFromUserSync bool `json:"ExemptFromUserSync,omitempty"`
PortalOnly bool `json:"PortalOnly,omitempty"`
}
ClmMember represents a CLM Member object — CLM's principal. Confirmed schema (richer than what the Patch/Put body alone shows, per Groups.GetUsers).
type ClmMemberGroupsPatch ¶ added in v0.1.8
type ClmMemberGroupsPatch struct {
Groups ClmGroupList `json:"Groups"`
}
ClmMemberGroupsPatch is the request body for PATCH/PUT .../members/{id} when granting (Patch, additive) or revoking (Put, full-replace) group membership. Deliberately a plain Items list, not the paginated ClmGroupPage used for reads — a write payload has no First/Href/Last/Limit/Next/Offset/Previous/Total metadata to send, and including response-only fields risks rejection if CLM's model binding is strict.
type ClmMemberPage ¶ added in v0.1.8
ClmMemberPage is the paginated collection of ClmMember.
type ClmPage ¶ added in v0.1.8
type ClmPage struct {
First string `json:"First"`
Href string `json:"Href"`
Last string `json:"Last"`
Limit int `json:"Limit"`
Next string `json:"Next"`
Offset int `json:"Offset"`
Previous string `json:"Previous"`
Total int `json:"Total"`
}
ClmPage is the pagination metadata CLM's Object API embeds in every list response — distinct from eSignature's Page (see models.go). Each *Page wrapper type below embeds this plus its own Items field, matching the confirmed response shape: {First, Href, Items, Last, Limit, Next, Offset, Previous, Total}.
type ClmPermissionSet ¶ added in v0.1.8
type ClmPermissionSet struct {
Href string `json:"Href"`
Name string `json:"Name"`
Permissions []string `json:"Permissions"`
}
ClmPermissionSet represents a CLM PermissionSet object. Confirmed schema: Name + Permissions (a list of PrivilegeType strings) — an account/feature-privilege bundle, NOT the same thing as a folder's AccessType/boolean-flag access levels. Confirmed read-only: no assignment/grant endpoint exists anywhere in the CLM API.
type ClmPermissionSetPage ¶ added in v0.1.8
type ClmPermissionSetPage struct {
ClmPage
Items []ClmPermissionSet `json:"Items"`
}
ClmPermissionSetPage is the paginated collection of ClmPermissionSet.
type ClmRole ¶ added in v0.1.8
type ClmRole struct {
Name string
}
ClmRole is a documented Member.Role value.
type ClmRoleSecurityEntry ¶ added in v0.1.8
type ClmRoleSecurityEntry struct {
AccessType string `json:"AccessType,omitempty"`
Item string `json:"Item"`
}
ClmRoleSecurityEntry is one folder-security grant to a CLM Role. Confirmed shape on writes (this connector's own PATCH body): flat {AccessType, Item}, Item the bare role name — unlike Groups/Users, a Role has no separate object to expand. Reads use a custom UnmarshalJSON tolerating either that flat string or a Groups/Users-style nested {Item: {Name: ...}} object: only Groups has been independently confirmed live (see ClmUserSecurityEntry's doc for the same gap on Users), so if CLM nests Roles too, decoding a JSON object into a bare Go string would otherwise hard-fail every clm_folder read/Grant/Revoke on that folder instead of just this one entry.
func (ClmRoleSecurityEntry) MarshalJSON ¶ added in v0.1.9
func (e ClmRoleSecurityEntry) MarshalJSON() ([]byte, error)
func (*ClmRoleSecurityEntry) UnmarshalJSON ¶ added in v0.1.9
func (e *ClmRoleSecurityEntry) UnmarshalJSON(data []byte) error
type ClmUserSecurityEntry ¶ added in v0.1.8
type ClmUserSecurityEntry struct {
AccessType string
Href string
Email string
UserName string
FirstName string
LastName string
Role string
}
ClmUserSecurityEntry is one folder-security grant to a CLM Member (user). Its UnmarshalJSON accepts both the nested {Item: {...}, AccessType} shape Groups use and a flat {Href, AccessType, ...} one, since Users' shape isn't confirmed live. An entry with no Href in either shape fails the decode: clmFolderSecurityToWrite round-trips the complete security state, so an empty Href would make an unrelated Grant/Revoke drop every other user's access. Grant/Revoke only need Href, so ClmMember's other fields are not repeated.
func (ClmUserSecurityEntry) MarshalJSON ¶ added in v0.1.9
func (e ClmUserSecurityEntry) MarshalJSON() ([]byte, error)
func (*ClmUserSecurityEntry) UnmarshalJSON ¶ added in v0.1.9
func (e *ClmUserSecurityEntry) UnmarshalJSON(data []byte) error
type ClmWorkflowQueue ¶ added in v0.1.9
ClmWorkflowQueue is a CLM WorkflowQueue (Member's workflow-queues response shape).
type ClmWorkflowQueuePage ¶ added in v0.1.9
type ClmWorkflowQueuePage struct {
ClmPage
Items []ClmWorkflowQueue `json:"Items"`
}
ClmWorkflowQueuePage is the paginated collection of ClmWorkflowQueue, returned by a member's workflow-queues endpoint.
type CreateUsersRequest ¶
type CreateUsersRequest struct {
NewUsers []NewUser `json:"newUsers"`
}
type DeleteUsersRequest ¶ added in v0.1.1
type DeleteUsersRequest struct {
Users []UserIdentifier `json:"users"`
}
DeleteUsersRequest represents a request to delete users from an account.
type DeleteUsersResponse ¶ added in v0.1.1
type DeleteUsersResponse struct {
Users []struct {
UserId string `json:"userId"`
UserName string `json:"userName"`
Email string `json:"email"`
UserStatus string `json:"userStatus"`
Success string `json:"success"`
ErrorDetails *struct {
ErrorCode string `json:"errorCode"`
Message string `json:"message"`
} `json:"errorDetails,omitempty"`
} `json:"users"`
}
DeleteUsersResponse represents the response from a user deletion request.
type EmailNotifications ¶
type ErrorResponse ¶ added in v0.0.5
type ErrorResponse struct {
ErrorCode string `json:"errorCode"`
ErrorMessage string `json:"message"`
}
func (*ErrorResponse) Message ¶ added in v0.0.5
func (e *ErrorResponse) Message() string
type GroupUserIdentifier ¶ added in v0.1.1
type GroupUserIdentifier struct {
UserId string `json:"userId"`
}
GroupUserIdentifier represents a user identifier for group operations.
type GroupUsersRequest ¶ added in v0.1.1
type GroupUsersRequest struct {
Users []GroupUserIdentifier `json:"users"`
}
GroupUsersRequest represents a request to modify group membership (add or remove users).
type GroupUsersResponse ¶ added in v0.1.1
type GroupUsersResponse struct {
Users []struct {
UserName string `json:"userName"`
UserId string `json:"userId"`
UserType string `json:"userType"`
UserStatus string `json:"userStatus"`
URI string `json:"uri"`
} `json:"users"`
}
GroupUsersResponse represents the response from modifying group membership.
type GroupsResponse ¶
type NewUser ¶
type NewUser struct {
UserName string `json:"userName"`
Email string `json:"email"`
UserSettings *UserSettings `json:"userSettings,omitempty"`
}
type OAuth2Docusign ¶
type OAuth2Docusign struct {
// contains filtered or unexported fields
}
OAuth2Docusign manages the OAuth2 configuration and token lifecycle for DocuSign.
func NewOAuth2Docusign ¶
func NewOAuth2Docusign(isDemo bool, clientID, clientSecret, redirectURI string, includeClm bool) *OAuth2Docusign
NewOAuth2Docusign initializes a new OAuth2Docusign helper with client credentials.
func (*OAuth2Docusign) Authorize ¶ added in v0.1.2
func (o *OAuth2Docusign) Authorize(ctx context.Context) (string, error)
Authorize initiates the OAuth2 authorization code flow and prompts the user to enter the authorization code.
func (*OAuth2Docusign) ExchangeCodeForToken ¶ added in v0.1.2
func (o *OAuth2Docusign) ExchangeCodeForToken(ctx context.Context, code string) (*oauth2.Token, error)
ExchangeCodeForToken exchanges an authorization code for an access token and refresh token.
type PageOptions ¶
type PermissionProfile ¶ added in v0.0.3
type PermissionProfilesResponse ¶ added in v0.0.3
type PermissionProfilesResponse struct {
Page
PermissionProfiles []PermissionProfile `json:"permissionProfiles"`
}
type SigningGroup ¶ added in v0.0.3
type SigningGroup struct {
SigningGroupId string `json:"signingGroupId"`
GroupName string `json:"groupName"`
GroupType string `json:"groupType"`
GroupEmail string `json:"groupEmail"`
Created string `json:"created"`
CreatedBy string `json:"createdBy"`
Modified string `json:"modified"`
ModifiedBy string `json:"modifiedBy"`
Users []SigningGroupUser `json:"users"`
}
type SigningGroupResponse ¶ added in v0.0.3
type SigningGroupResponse struct {
Page
SigningGroups []SigningGroup `json:"groups"`
}
type SigningGroupUser ¶ added in v0.0.3
type SigningGroupUser struct {
UserID string `json:"userId,omitempty"`
UserName string `json:"userName,omitempty"`
Email string `json:"email,omitempty"`
}
SigningGroupUser represents a user member of a SigningGroup.
type SigningGroupUserIdentifier ¶ added in v0.1.1
type SigningGroupUserIdentifier struct {
UserName string `json:"userName"`
Email string `json:"email"`
}
SigningGroupUserIdentifier represents a user identifier for signing group operations.
type SigningGroupUsersRequest ¶ added in v0.1.1
type SigningGroupUsersRequest struct {
Users []SigningGroupUserIdentifier `json:"users"`
}
SigningGroupUsersRequest represents a request to modify signing group membership (add or remove users).
type SigningGroupUsersResponse ¶ added in v0.1.1
type SigningGroupUsersResponse struct {
SigningGroupId string `json:"signingGroupId"`
GroupName string `json:"groupName"`
GroupType string `json:"groupType"`
Created string `json:"created"`
CreatedBy string `json:"createdBy"`
Modified string `json:"modified"`
ModifiedBy string `json:"modifiedBy"`
Users []struct {
UserName string `json:"userName"`
Email string `json:"email"`
} `json:"users"`
}
SigningGroupUsersResponse represents the response from modifying signing group membership.
type TokenResponse ¶
type UpdateUserProfileRequest ¶ added in v0.1.1
type UpdateUserProfileRequest struct {
UserDetails struct {
PermissionProfileId string `json:"permissionProfileId"`
} `json:"userDetails"`
}
UpdateUserProfileRequest represents a request to update a user's permission profile.
type UserCreationResponse ¶
type UserCreationResponse struct {
NewUsers []struct {
UserId string `json:"userId"`
URI string `json:"uri"`
Email string `json:"email"`
UserName string `json:"userName"`
UserStatus string `json:"userStatus"`
CreatedDateTime string `json:"createdDateTime"`
MembershipId string `json:"membershipId"`
ErrorDetails *struct {
ErrorCode string `json:"errorCode"`
Message string `json:"message"`
} `json:"errorDetails,omitempty"`
} `json:"newUsers"`
}
type UserDetail ¶
type UserDetail struct {
UserID string `json:"userId"`
UserName string `json:"userName"`
Email string `json:"email"`
IsAdmin string `json:"isAdmin"`
UserStatus string `json:"userStatus"`
PermissionProfileName string `json:"permissionProfileName"`
PermissionProfileID string `json:"permissionProfileId"`
UserSettings UserSettings `json:"userSettings"`
GroupList []Group `json:"groupList"`
}
type UserIdentifier ¶ added in v0.1.1
type UserIdentifier struct {
UserId string `json:"userId"`
}
UserIdentifier represents a user identifier for deletion operations.
type UserInfoResponse ¶ added in v0.0.6
type UserInfoResponse struct {
Sub string `json:"sub"`
Name string `json:"name"`
Email string `json:"email"`
Accounts []AccountInfo `json:"accounts"`
}
UserInfoResponse represents the response from DocuSign's OAuth User Info endpoint.
type UserSettings ¶
type UserSettings struct {
CanManageAccount string `json:"canManageAccount"`
AccountManagementGranular AccountManagement `json:"accountManagementGranular"`
CanSendEnvelope string `json:"canSendEnvelope"`
CanSignEnvelope string `json:"canSignEnvelope"`
AllowSendOnBehalfOf string `json:"allowSendOnBehalfOf"`
BulkSend string `json:"bulkSend"`
CanSendAPIRequests string `json:"canSendAPIRequests"`
EnableSequentialSigningUI string `json:"enableSequentialSigningUI"`
EnableDSPro string `json:"enableDSPro"`
CanUseScratchpad string `json:"canUseScratchpad"`
CanCreateWorkspaces string `json:"canCreateWorkspaces"`
EnableTransactionPoint string `json:"enableTransactionPoint"`
PowerFormMode string `json:"powerFormMode"`
APICanExportAC string `json:"apiCanExportAC"`
EnableVaulting string `json:"enableVaulting"`
CanManageTemplates string `json:"canManageTemplates"`
AdminOnly string `json:"adminOnly"`
CanManageDistributor string `json:"canManageDistributor"`
CanManageOrganization string `json:"canManageOrganization"`
CanUseSmartContracts string `json:"canUseSmartContracts"`
SignerEmailNotifications EmailNotifications `json:"signerEmailNotifications"`
SenderEmailNotifications EmailNotifications `json:"senderEmailNotifications"`
}
type UsersResponse ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package clmtest provides an in-memory mock of the DocuSign eSignature /oauth/userinfo endpoint, CLM's account discovery endpoint, and the DocuSign CLM Object API, for use by tests in pkg/client and pkg/connector.
|
Package clmtest provides an in-memory mock of the DocuSign eSignature /oauth/userinfo endpoint, CLM's account discovery endpoint, and the DocuSign CLM Object API, for use by tests in pkg/client and pkg/connector. |