visma

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OptionDebug

func OptionDebug(b bool) func(*VismaSign)

func OptionHTTPClient

func OptionHTTPClient(client httpClient) func(*VismaSign)

Types

type AddFileDocumentResponse

type AddFileDocumentResponse struct {
	FileID string `json:"uuid"`
}

type AuthenticationMethod

type AuthenticationMethod struct {
	Identifier string `json:"identifier"`
	Name       string `json:"name"`
	Image      string `json:"image"`
}

type CategoriesResponse

type CategoriesResponse struct {
	Categories []Category `json:"categories"`
}

type Category

type Category struct {
	UUID        string      `json:"uuid"`
	Name        string      `json:"name"`
	Description string      `json:"description"`
	Permissions Permissions `json:"permissions"`
}

type CategoryRequest

type CategoryRequest struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
}

type CreateCategoryResponse

type CreateCategoryResponse struct {
	ID string
}

type CreateDocumentRequest

type CreateDocumentRequest struct {
	Name                  string     `json:"name"`
	CategoryUUID          string     `json:"category_uuid,omitempty"`
	Category              string     `json:"category,omitempty"`
	InvitationsValidUntil *time.Time `json:"invitations_valid_until,omitempty"`
}

type CreateDocumentResponse

type CreateDocumentResponse struct {
	DocumentID string
}

type CreateInvitationRequest

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

func (*CreateInvitationRequest) Add

type Creator

type Creator struct {
	Organization string `json:"organization"`
	Person       string `json:"person"`
}

type Document

type Document struct {
	UUID                  string       `json:"uuid"`
	Name                  string       `json:"name"`
	Status                string       `json:"status"`
	CreatedOn             string       `json:"created_on"`
	Category              string       `json:"category_uuid"`
	InvitationsValidUntil string       `json:"invitations_valid_until"`
	Files                 []File       `json:"files"`
	Invitations           []Invitation `json:"invitations"`
	CreatedBy             Creator      `json:"created_by"`
	IsOwner               bool         `json:"is_owner"`
}

type File

type File struct {
	Filename string `json:"filename"`
}

type GetAuthenticationMethodsResponse

type GetAuthenticationMethodsResponse struct {
	Methods []AuthenticationMethod `json:"methods"`
}

type GetInviteeGroupsResponse

type GetInviteeGroupsResponse struct {
	InviteeGroups []InviteeGroup `json:"invitee_groups"`
}

type Invitation

type Invitation struct {
	UUID       string `json:"uuid"`
	Status     string `json:"status"`
	Passphrase string `json:"passphrase"`
	Email      string `json:"email"`
	Sms        string `json:"sms"`
	SignerName string `json:"signer_name"`
}

type InvitationMessages

type InvitationMessages struct {
	SendInvitationEmail           bool   `json:"send_invitation_email,omitempty"`
	InvitationEmailMessage        string `json:"invitation_email_message,omitempty"`
	SendInvitationSms             bool   `json:"send_invitation_sms,omitempty"`
	CustomSms                     string `json:"custom_sms,omitempty"`
	SeparateInviteeParts          bool   `json:"separate_invite_parts,omitempty"`
	SendInviteeAllCollectedEmail  bool   `json:"send_invitee_all_collected_email,omitempty"`
	SendInviterOneCollectedEmails bool   `json:"send_inviter_one_collected_emails,omitempty"`
	AttachmentAllowed             bool   `json:"attachment_allowed,omitempty"`
}

type InvitationRequest

type InvitationRequest struct {
	Email              string              `json:"email,omitempty"`
	IdentifierType     string              `json:"identifier_type,omitempty"`
	Identifier         string              `json:"identifier,omitempty"`
	Sms                string              `json:"sms,omitempty"`
	Name               string              `json:"name,omitempty"`
	SignAsOrganization bool                `json:"sign_as_organization,omitempty"`
	Language           string              `json:"language,omitempty"`
	Messages           *InvitationMessages `json:"messages,omitempty"`
	Inviter            *Inviter            `json:"inviter,omitempty"`
	Order              *Order              `json:"order,omitempty"`
}

type InviteeGroup

type InviteeGroup struct {
	UUID string `json:"uuid"`
	Name string `json:"name"`
}

type Inviter

type Inviter struct {
	Name     string `json:"name,omitempty"`
	Email    string `json:"email,omitempty"`
	Language string `json:"language,omitempty"`
}

type Option

type Option func(*VismaSign)

type Order

type Order struct {
	Index                               int  `json:"index,omitempty"`
	RequireBeforeSendingNextInvitations bool `json:"require_before_sending_next_invitations,omitempty"`
}

type Permissions

type Permissions struct {
	Read  bool `json:"read"`
	Write bool `json:"write"`
}

type SearchDocumentCriteria

type SearchDocumentCriteria interface {
	Category(string) SearchDocumentCriteria
	Name(string) SearchDocumentCriteria
	UUID(string) SearchDocumentCriteria
	DateFrom(string) SearchDocumentCriteria
	DateTo(string) SearchDocumentCriteria
	Status(string) SearchDocumentCriteria
	Participant(string) SearchDocumentCriteria
	SortBy(string) SearchDocumentCriteria
	SortOrder(string) SearchDocumentCriteria
	Offset(int) SearchDocumentCriteria
	// contains filtered or unexported methods
}

func NewSearchDocumentCriteria

func NewSearchDocumentCriteria() SearchDocumentCriteria

type SearchDocumentResponse

type SearchDocumentResponse struct {
	Total     int        `json:"total"`
	Offset    int        `json:"offset"`
	Length    int        `json:"length"`
	Documents []Document `json:"documents"`
}

type ValidationError

type ValidationError struct {
	Path       string `json:"path"`
	Error      string `json:"error"`
	Code       string `json:"code"`
	Name       string `json:"name"`
	Value      string `json:"value"`
	Parameters struct {
		Value string `json:"value"`
	} `json:"parameters"`
}

type VismaError

type VismaError struct {
	Title            string            `json:"error"`
	ValidationErrors []ValidationError `json:"validation_errors"`
}

func (VismaError) Error

func (e VismaError) Error() string

type VismaSign

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

func New

func New(identifier, key string, options ...Option) *VismaSign

func (VismaSign) AddFileDocument

func (v VismaSign) AddFileDocument(documentID string, fileReader io.Reader, filename string) (*AddFileDocumentResponse, error)

func (VismaSign) CancelDocument

func (v VismaSign) CancelDocument(documentID string) error

func (VismaSign) CreateCategory

func (v VismaSign) CreateCategory(request CategoryRequest) (*CreateCategoryResponse, error)

func (VismaSign) CreateDocument

func (v VismaSign) CreateDocument(req CreateDocumentRequest) (*CreateDocumentResponse, error)

func (VismaSign) CreateInvitations

func (v VismaSign) CreateInvitations(documentID string, invitations []InvitationRequest) ([]Invitation, error)

func (*VismaSign) Debug

func (v *VismaSign) Debug() bool

func (*VismaSign) Debugln

func (v *VismaSign) Debugln(t ...interface{})

func (VismaSign) DeleteCategory

func (v VismaSign) DeleteCategory(categoryID string) error

func (VismaSign) DeleteDocument

func (v VismaSign) DeleteDocument(documentID string) error

func (VismaSign) GetAuthenticationMethods

func (v VismaSign) GetAuthenticationMethods() (*GetAuthenticationMethodsResponse, error)

func (VismaSign) GetCategories

func (v VismaSign) GetCategories() (*CategoriesResponse, error)

func (VismaSign) GetDocument

func (v VismaSign) GetDocument(documentID string) (*Document, error)

func (VismaSign) GetDocumentFile

func (v VismaSign) GetDocumentFile(documentID string) (io.Reader, error)

func (VismaSign) RemindAll

func (v VismaSign) RemindAll(documentId string) error

func (VismaSign) RemindOneInvitee

func (v VismaSign) RemindOneInvitee(invitationID string) error

func (VismaSign) SearchDocument

func (v VismaSign) SearchDocument(criteria SearchDocumentCriteria) (*SearchDocumentResponse, error)

func (VismaSign) UpdateCategory

func (v VismaSign) UpdateCategory(categoryID string, request CategoryRequest) error

Jump to

Keyboard shortcuts

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