boldchat

package module
v0.0.0-...-d33cfbc Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: MIT Imports: 11 Imported by: 0

README

BoldChat API in Go Go Report Card GoDoc

This library supports most of the BoldChat web API for use in Go.

NOTE: This is currently in early Alpha and not intended for production use.

Installing

go get -v github.com/hlfstr/boldchat

Usage

Check the Examples! Check the GoDocs!

Changelog

The changelog is available at CHANGELOG.md

Documentation

Index

Constants

View Source
const (
	US   = "api.boldchat.com"
	EMEA = "api-eu.boldchat.com"
)

const definitions of the BoldChat API endpoints for the 2 regions available

US for North America
EMEA for Europe, Middle East, or Africa
View Source
const (
	LIBNAME    = "BoldChat"
	MAJVERSION = 0
	MINVERSION = 1
	RELVERSION = 0
)

Constants that defines self-awareness LIBNAME is the name MAJVERSION is the major version number MINVERSION is the minor version number RELVERSION is the release version number

Variables

This section is empty.

Functions

func Version

func Version() string

Version returns a string that contains the name and version all nice and neat

Types

type Client

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

Client is the BoldChat object that is used for all operations

func New

func New(id, setting, key, end string) *Client

New creates a new BoldChat Client object

func (*Client) EditOperator

func (c *Client) EditOperator(op *Operator) error

EditOperator is the 'editOperator' API Call requires an Operator object Any Operator value that can be changed will be sent if the value in the object is not empty The LoginID value MUST be set correctly or an error is thrown returns an error if applicable reference: https://developer.bold360.com/help/EN/Bold360API/Bold360API/c_provisioning_operator_editOperator.html

func (*Client) GetOperator

func (c *Client) GetOperator(id string) (*Operator, error)

GetOperator is the 'getOperator' API Call requires the OperatorID returns the Operator or an error reference: https://developer.bold360.com/help/EN/Bold360API/Bold360API/c_data_extraction_single_item_getOperator.html

func (*Client) GetOperatorByEmail

func (c *Client) GetOperatorByEmail(email string) (*Operator, error)

GetOperatorByEmail is a convenience function to get an operator by their email address Calls the 'getOperators' function call, and returns the matching user or an error

func (*Client) GetOperatorByName

func (c *Client) GetOperatorByName(name string) (*Operator, error)

GetOperatorByName is a convenience function to get an operator by their Name Calls the 'getOperators' function call, and returns the matching user or an error

func (*Client) GetOperators

func (c *Client) GetOperators() ([]*Operator, error)

GetOperators is the 'getOperators' API Call returns the full list of operators found or an error reference: https://developer.bold360.com/help/EN/Bold360API/Bold360API/c_data_extraction_list_data_getOperators.html

type Operator

type Operator struct {
	Name              string `json:"Name"`
	OperatorName      string `json:"OperatorName"`
	Email             string `json:"Email"`
	LoginID           string `json:"LoginID"`
	ChatName          string `json:"ChatName"`
	SSONameID         string `json:"SSONameID"`
	EmailName         string `json:"EmailName"`
	PermissionGroupID string `json:"PermissionGroupID"`
	Disabled          string `json:"Disabled"`

	Departments    []*OperatorDepartment `json:"Departments"`
	TwitterService *OperatorService      `json:"TwitterService"`
	EmailService   *OperatorService      `json:"EmailService"`
	ChatService    *OperatorService      `json:"ChatService"`
	SmsService     *OperatorService      `json:"SmsService"`
}

Operator is the data type matching the Operator JSON object according to the BoldChat API

func (Operator) String

func (u Operator) String() string

String is a helper function to print

type OperatorDepartment

type OperatorDepartment struct {
	AssignmentPriority int    `json:"AssignmentPriority"`
	Priority           int    `json:"Priority"`
	DepartmentID       string `json:"DepartmentID"`
}

OperatorDepartment is the struct for the Departments in the Operators JSON Object

func (OperatorDepartment) String

func (ud OperatorDepartment) String() string

String is a helper function to print

type OperatorService

type OperatorService struct {
	Available bool `json:"Available"`
	Capacity  int  `json:"Capacity"`
}

OperatorService is the struct for the Services in the Operators JSON Object

func (OperatorService) String

func (us OperatorService) String() string

String is a helper function to print

type Response

type Response struct {
	Status  string `json:"Status"`
	Message string `json:"Message"`
}

Response is the base Response object returned from BoldChat All API Responses should contain the following Status is the status returned from the API Call Message contains the message returned

Only populated if status is an error

func (Response) Good

func (r Response) Good() bool

Good checks if the response is success returns a bool type

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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