client

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 24 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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:

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 are derived from DocuSign's CLM API reference (method tables and request/response schemas). Validate against cmd/test-server during development. Live-tested end-to-end against a real CLM tenant (demo/UAT environment): Groups/Members/PermissionSets/Roles all synced correctly with their entitlements and grants, once the authorizing user had admin rights in that environment — an earlier 401 "Access Denied" on every data call (discovery succeeded) turned out to be exactly that, not a scope, licensing, or demo-vs- production issue as initially suspected. Folders required a separate fix — see SearchFolders' doc for the confirmed request/response shape.

API Endpoints Used

Folders:

  • POST /v2/{accountId}/foldersearchtasks - Search for folders (async Task API — see SearchFolders' doc). Prefer this over the also-documented Folders:Search (POST /v2/{accountId}/folders/search), which returns 405 live.
  • 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), confirmed via DocuSign's own Folders.Patch reference page - 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: that endpoint accepts a Security field in its documented schema but silently ignores it live (confirmed: 200 OK, no error, but a fresh GET shows no change, while a trivial PATCH of another field on the same folder did apply). CLM's own error code list names a distinct "136 - Missing Change Security Task", and the CLM API Reference confirms ChangeSecurityTasks as its own Task API resource for this. This rewrite matches ChangeSecurityTasks' documented request/response schema but is NOT independently verified live — per explicit instruction, this project is done live-testing against the customer's tenant.

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), and an earlier version of this code incorrectly read it from the token's Extra data as a result.

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

View Source
const (
	ClmChangeSecurityStatusSuccess    = "success"
	ClmChangeSecurityStatusWaiting    = "waiting"
	ClmChangeSecurityStatusFailure    = "failure"
	ClmChangeSecurityStatusProcessing = "processing"
)

clmChangeSecurityStatus* are ChangeSecurityTasks' documented Status values — lowercase, distinct from FolderSearchTasks' PascalCase. See PatchFolderSecurity's doc.

View Source
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.

View Source
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.

View Source
const DefaultPageSize = 100

Variables

View Source
var ClmFolderSearchTaskPollInterval = 2 * time.Second

ClmFolderSearchTaskPollInterval is how long SearchFolders waits between polls of a "Processing" FolderSearchTasks task. Exported, like DefaultPageSize, so tests can override it — a real poll cadence would make a test exercising this branch needlessly slow.

View Source
var ClmRoles = []ClmRole{
	{Name: "Guest"},
	{Name: "LimitedSubscriber"},
	{Name: "FullSubscriber"},
	{Name: "UserAdministrator"},
	{Name: "SuperAdministrator"},
}

ClmRoles are the confirmed, fixed set of CLM account-level roles.

Functions

func ApplyQueryParam added in v0.0.3

func ApplyQueryParam(reqURL *url.URL, key string, value string)

func IDFromHref added in v0.1.9

func IDFromHref(href string) string

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

func IsClmNoWorkflowTaskGroupsError(err error) bool

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

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

DeleteUsers sends a bulk delete request to remove users from the account.

func (*Client) EnsureClmReady added in v0.1.9

func (c *Client) EnsureClmReady(ctx context.Context) error

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

func (c *Client) EnsureReady(ctx context.Context) error

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) 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.

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) 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

func (c *Client) GroupHref(ctx context.Context, groupID string) (string, error)

GroupHref builds a CLM group's Href from its native ID — see hrefFor's doc.

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

func (c *Client) MemberHref(ctx context.Context, memberID string) (string, error)

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 — a dedicated async Task API endpoint, NOT the generic Folders Patch this function used to call. Confirmed live that the generic PATCH /v2/{accountId}/folders/{id} silently ignores a Security payload entirely (200 OK, no error, but a fresh GET shows no change — a trivial PATCH of another field on the same folder DID apply and bump UpdatedDate, isolating the failure to Security specifically); CLM's own error code list separately names "136 - Missing Change Security Task", and the CLM API Reference confirms a distinct ChangeSecurityTasks resource ("Post: Set the security on a folder") exists for exactly this. See clm_client.go's package doc "Folders" section for the live evidence that led here.

The request body shape (ClmChangeSecurityTaskRequest) is confirmed via the CLM API Reference's interactive schema browser, expanded past its default collapsed view — the target folder's Href and its new Security both nest under a Folder field; a same-shaped top-level Href/Security/Status on the schema are generic Task-wrapper fields this doc-generation tool reuses across every Task type, not what ChangeSecurityTasks actually reads for a folder security change (an earlier version of this code got this wrong from the same page's default collapsed view, which looks identical to a flat {Href, Security} pair until "Folder" is expanded).

NOT independently verified live: per explicit instruction, this project is done live-testing against the customer's tenant. ChangeSecurityTasks' Status values are documented in lowercase (success/waiting/failure/processing) — confirmed distinct from FolderSearchTasks' PascalCase (Success/Processing), not a documentation inconsistency to normalize away — is the other thing worth a second look if this doesn't work in practice.

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) SearchFolders added in v0.1.8

func (c *Client) SearchFolders(ctx context.Context, options PageOptions) ([]ClmFolder, string, annotations.Annotations, error)

SearchFolders discovers folders via CLM's FolderSearchTasks (CLM API Reference → Tasks → FolderSearchTasks). Unlike Groups/Members/PermissionSets there is no flat list-all for folders. The Reference also documents Folders:Search (POST /v2/{accountId}/folders/search); this connector follows FolderSearchTasks because that sync path returns 405 live (see bullets below). A POST creates a search task, which either resolves inline or must be polled via its own Href until Status leaves "Processing", after which the paginated folder list is read from the task's Result. (FolderSearchTasks' Status field is an unenumerated string in the schema — live returns Title-Case "Success"/"Processing", distinct from ChangeSecurityTasks' documented lowercase success/waiting/failure/processing.)

Confirmed live against a real CLM tenant:

  • POST /v2/{accountId}/folders/search (Folders:Search in the Reference — this function's original implementation) returns 405 Method Not Allowed, so the documented sync search is not usable on the tenants we hit.
  • POST /v2/{accountId}/foldersearchtasks requires a recognized search parameter in the body — an empty body, or {"Name": ...} (the field ClmFolder's own JSON tag uses), is rejected with CLM ErrorCode 1024 "no valid search parameter" against every property name tried except "Title". {"Title": ""} is accepted and matches every folder (Title is a substring match, so empty matches everything) — confirmed against a real account with 100 folders. Title is a documented FolderSearchTask request field in the Reference.
  • The task resolved inline (Status "Success" already in the POST response, Result already populated) on every live test; the "Processing" polling branch below is unverified live.
  • Continuation pages don't re-POST a new search: they GET the task's own Result href (offset/limit appended) directly, confirmed live to return the same flat, paginated shape as every other CLM list endpoint.

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 — see PatchFolderSecurity's doc in clm_client.go. Confirmed via the CLM API Reference's interactive schema browser (its default collapsed view initially looked like a flat {Href, Security} pair sibling to Status — an earlier version of this struct assumed exactly that — but expanding "Folder" shows it's the *complete* Folder object schema, itself carrying its own nested Href and Security fields; the outer Href/Security alongside Status are generic Task-wrapper fields this doc-generation tool reuses across every Task type, not what ChangeSecurityTasks actually reads for a folder security change). The target folder and its new security both nest under Folder.

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 — per the CLM API Reference's documented "Task.ChangeSecurityTask" schema (confirmed live via the rendered doc site, not just its collapsed default view — see ClmChangeSecurityTaskRequest's doc for why that distinction mattered here). The full 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 uses a distinct, lowercase vocabulary from FolderSearchTasks — see PatchFolderSecurity's doc in clm_client.go. Not independently confirmed live (no more live-testing against the customer tenant).

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

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

type ClmFolderPage struct {
	ClmPage
	Items []ClmFolder `json:"Items"`
}

ClmFolderPage is the paginated collection of ClmFolder (e.g. from Search).

type ClmFolderRef added in v0.1.8

type ClmFolderRef struct {
	Href string `json:"Href"`
	Name string `json:"Name,omitempty"`
}

ClmFolderRef is a lightweight folder reference (e.g. ParentFolder).

type ClmFolderSearchTaskResponse added in v0.1.9

type ClmFolderSearchTaskResponse struct {
	Status string         `json:"Status"`
	Href   string         `json:"Href"`
	Result *ClmFolderPage `json:"Result,omitempty"`
}

ClmFolderSearchTaskResponse is CLM's FolderSearchTasks response envelope — the same shape whether returned by the initial POST (create) or a poll GET on the task's own Href. Confirmed live for the POST/"Success" case (Result already populated with the same Items/Offset/Limit/Total/Next fields as every other CLM list endpoint); the CLM Task API 101 docs describe the identical {Status, Href, Result} envelope for DocumentSearchTasks, CLM's sibling search-task resource — see SearchFolders' doc in clm_client.go for what's confirmed vs. assumed.

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. Confirmed live against a real CLM tenant (GetFolder?expand=Security) to be three SEPARATE, flat (non-paginated) arrays by principal type — no First/Href/Last/Limit/ Next/Offset/Previous/Total pagination envelope wraps them the way every other CLM list response does; an earlier version of this struct wrapped each in a page type based on an unconfirmed reading of the Folders.Patch reference page, which caused a live sync to fail entirely with a JSON unmarshal error (array where an object with an Items field was expected).

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: Folders.Patch's 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 PATCH sends the same {Item: {...}, AccessType} shape confirmed live on reads. This WAS tested live, against a disposable folder created and deleted solely for the check — and had no effect: see clm_client.go's package doc "Folders" section for the full evidence chain. Neither this shape nor a flat {Href, AccessType} one worked, with either PATCH or PUT; a distinct CLM error code ("136 - Missing Change Security Task") suggests the real mechanism is a dedicated Task API endpoint, not this generic object Patch. Grant/Revoke on clm_folder are NOT confirmed to work against a real CLM tenant — this is a known, open gap, not a residual unconfirmed assumption.

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

type ClmGroupPage struct {
	ClmPage
	Items []ClmGroup `json:"Items"`
}

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. Confirmed live: the wire shape nests the group's own fields under an "Item" key, sibling to AccessType — {"Item": {"Href":...,"Name":...,...}, "AccessType":"View"} — not a flat merge of AccessType into the group's fields as an earlier version of this struct assumed (that assumption was never actually confirmed against a live tenant, despite its doc comment's claim otherwise). Kept as a flat Go struct via custom (Un)MarshalJSON so callers in pkg/connector/clm_folders.go don't need to know about the wire-level nesting — mirrors ClmRoleSecurityEntry's existing bare-Item shape, just for an object Item instead of a string one.

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 an account-level enum: Guest/LimitedSubscriber/FullSubscriber/
	// UserAdministrator/SuperAdministrator. This is the "Role" grantee type
	// referenced in folder Security's "by role, group, and user".
	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

type ClmMemberPage struct {
	ClmPage
	Items []ClmMember `json:"Items"`
}

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 static, hardcoded representation of one of the 5 fixed account-level Member.Role values. Not backed by an API call — needed so folder-security entries granted "by role" (Item referencing a Role rather than a Group/User) have a real synced resource to attach the grant to. See pkg/connector/clm_roles.go.

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). Read via a custom UnmarshalJSON tolerating both ClmGroupSecurityEntry's confirmed nested {Item: {...}, AccessType} wire shape and a flat {Href, AccessType, ...} one: Users' shape isn't independently confirmed live (every populated folder-security entry found on the live tenant this was tested against was a Group), and guessing wrong on a struct-typed Item field fails silently (a missing key leaves Item's fields at their zero value, not a decode error) rather than loudly — see the review finding that caught this: every existing user's Href would decode as "", and since clmFolderSecurityToWrite round-trips the complete security state on every Grant/Revoke, an unrelated write could silently blank and then drop every other user's folder access. Deliberately doesn't repeat every field ClmMember has (Address*, City, Company, etc.): Grant/Revoke only ever need Href to identify the member, never reconstruct a full member profile from a security entry.

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

type ClmWorkflowQueue struct {
	Href string `json:"Href"`
	Name string `json:"Name"`
}

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 EmailNotifications struct {
	EnvelopeActivation string `json:"envelopeActivation"`
	EnvelopeComplete   string `json:"envelopeComplete"`
	EnvelopeDeclined   string `json:"envelopeDeclined"`
}

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 Group

type Group struct {
	GroupId    string `json:"groupId"`
	GroupName  string `json:"groupName"`
	GroupType  string `json:"groupType"`
	UsersCount string `json:"usersCount"`
}

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 GroupsResponse struct {
	Page
	Groups []Group `json:"groups"`
}

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 Page

type Page struct {
	ResultSetSize int `json:"resultSetSize,string"`
	TotalSetSize  int `json:"totalSetSize,string"`
	StartPosition int `json:"startPosition,string"`
	EndPosition   int `json:"endPosition,string"`
}

type PageOptions

type PageOptions struct {
	PageSize  int
	PageToken string
}

type PermissionProfile added in v0.0.3

type PermissionProfile struct {
	PermissionProfileId   string    `json:"permissionProfileId"`
	PermissionProfileName string    `json:"permissionProfileName"`
	ModifiedDateTime      time.Time `json:"modifiedDateTime"`
	ModifiedByUserName    string    `json:"modifiedByUsername"`
}

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 TokenResponse struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
}

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 User

type User struct {
	UserId     string `json:"userId"`
	UserName   string `json:"userName"`
	Email      string `json:"email"`
	UserStatus string `json:"userStatus"`
	IsAdmin    string `json:"isAdmin"`
	Permission string `json:"permissionProfileName"`
}

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"`
	CanEditSharedAddressbook  string             `json:"canEditSharedAddressbook"`
	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

type UsersResponse struct {
	Page
	Users []User `json:"users"`
}

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.

Jump to

Keyboard shortcuts

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