client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPageSize = 50

Variables

This section is empty.

Functions

This section is empty.

Types

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, handling auth and base URL.

func New

func New(ctx context.Context, apiUrl, accountId, clientID, clientSecret, redirectURI, refreshToken string) (*Client, error)

New constructs a Client, choosing OAuth2 interactive flow or direct token based on accessToken.

func NewClient

func NewClient(ctx context.Context, apiUrl, accountId string, tokenSource oauth2.TokenSource, httpClient ...*uhttp.BaseHttpClient) *Client

NewClient initializes a Client with a fixed token and optional HTTP wrapper.

func (*Client) CreateUsers

CreateUsers sends a bulk create request for new users in the account.

func (*Client) GetGroupUsers

func (c *Client) GetGroupUsers(ctx context.Context, groupId string, options PageOptions) ([]User, string, annotations.Annotations, error)

GetGroupUsers fetches users for a group with pagination support.

func (*Client) GetGroups

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

GetGroups fetches a page of groups and handles pagination and rate limit annotations.

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 and returns users, next page token, and annotations.

type CreateUsersRequest

type CreateUsersRequest struct {
	NewUsers []NewUser `json:"newUsers"`
}

type EmailNotifications

type EmailNotifications struct {
	EnvelopeActivation string `json:"envelopeActivation"`
	EnvelopeComplete   string `json:"envelopeComplete"`
	EnvelopeDeclined   string `json:"envelopeDeclined"`
}

type Group

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

type GroupsResponse

type GroupsResponse struct {
	Groups []Group `json:"groups"`
	Page   Page
}

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(clientID, clientSecret, redirectURI string) *OAuth2Docusign

NewOAuth2Docusign initializes a new OAuth2Docusign helper with client credentials.

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 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 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"`
	UserSettings          UserSettings `json:"userSettings"`
	GroupList             []Group      `json:"groupList"`
}

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 {
	Users []User `json:"users"`
	Page  Page
}

Jump to

Keyboard shortcuts

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