client

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 12, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ItemsPerPage = 50 // Common default number of items per page as per PandaDoc API

Variables

This section is empty.

Functions

func GetNextPageToken added in v0.0.4

func GetNextPageToken(total int, opts PageOptions) string

Types

type Option

type Option func(client *PandaDocClient)

func WithBearerToken

func WithBearerToken(apiToken string) Option

func WithEuropeDomain added in v0.0.4

func WithEuropeDomain(europeDomain bool) Option

type PageOptions

type PageOptions struct {
	Count int `url:"count,omitempty"`
	Page  int `url:"page,omitempty"`
}

PageOptions is options for list method of paginatable resources. It's used to create query string.

type PandaDocClient

type PandaDocClient struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, opts ...Option) (*PandaDocClient, error)

func NewClient

func NewClient(httpClient ...*uhttp.BaseHttpClient) *PandaDocClient

func (*PandaDocClient) ListUsers

func (*PandaDocClient) ListWorkspaces

type ReqOpt

type ReqOpt func(reqURL *url.URL)

func WithPage

func WithPage(page int) ReqOpt

page: Number for the page (inclusive). The page number starts with 1. If page is 0, first page is assumed.

func WithPageLimit

func WithPageLimit(count int) ReqOpt

count : items per page.

func WithQueryParam

func WithQueryParam(key string, value string) ReqOpt

type Role

type Role struct {
	Description string `json:"description,omitempty"`
	Name        string `json:"name,omitempty"`
	IsSystem    bool   `json:"is_system,omitempty"`
}

type User

type User struct {
	ID                  string `json:"user_id"`
	Email               string `json:"email"`
	FirstName           string `json:"first_name,omitempty"`
	Lastame             string `json:"last_name,omitempty"`
	Phone               string `json:"phone_number,omitempty"`
	IsOrganizationOwner bool   `json:"is_organization_owner"`
	License             string `json:"license"`
	Workspaces          []struct {
		Role         string `json:"role"`
		WorkspaceID  string `json:"workspace_id"`
		MembershipID string `json:"membership_id"`
	}
}

type UserResponse

type UserResponse struct {
	Users []User `json:"results"`
	Total int    `json:"total"`
}

type Workspace

type Workspace struct {
	ID          string    `json:"id"`
	Name        string    `json:"name"`
	Owner       string    `json:"owner"`
	DateCreated time.Time `json:"date_created"`
}

type WorkspaceResponse

type WorkspaceResponse struct {
	Workspaces []Workspace `json:"results"`
	Total      int         `json:"total"`
}

Jump to

Keyboard shortcuts

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