lite

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EngageVoiceServerURL    string = "https://portal.vacd.biz"
	EngageVoiceLoginURL     string = "https://portal.vacd.biz/api/v1/auth/login"
	EngageVoiceTokenURL     string = "https://portal.vacd.biz/api/v1/admin/token"
	EngageVoiceTokenURLPath string = "/api/v1/admin/token"
	EngageVoiceTokenHeader  string = "x-auth-token"
)
View Source
const (
	EnvEngageVoiceServerURL = "ENGAGE_VOICE_SERVER_URL"
	EnvEngageVoiceAccountID = "ENGAGE_VOICE_ACCOUNT_ID"
	EnvEngageVoiceToken     = "ENGAGE_VOICE_TOKEN"
	APIUsersURLPath         = "/api/v1/admin/users"
	APITokensURLPath        = "/api/v1/admin/token"
)

Variables

This section is empty.

Functions

func APIInfo

func APIInfo(serverURL, urlPath, authOrApiToken string) (http.Header, string, error)

func ExchangeAPIToken

func ExchangeAPIToken(authToken string) (string, error)

func GetUsers

func GetUsers(serverURL, authOrApiToken string) ([]byte, error)

func ListTokens

func ListTokens(serverURL, authOrApiToken string) ([]string, error)

func NewClientRingCentralPassword

func NewClientRingCentralPassword(rcCredentials []byte) (*http.Client, error)

func NewClientToken

func NewClientToken(token string) *http.Client

func NewHTTPClient

func NewHTTPClient(token string) *http.Client

func RequestAuthToken

func RequestAuthToken(username, password string) (*LoginSuccess, *LoginError, *http.Response, error)

Types

type Account

type Account struct {
	MainAccountID               string `json:"mainAccountId"`
	AccountID                   string `json:"accountId"`
	AccountName                 string `json:"accountName"`
	EnableMultiUser             bool   `json:"enableMultiUser"`
	EnableSoftphones            bool   `json:"enableSoftphones"`
	TcpaSafeMode                bool   `json:"tcpaSafeMode"`
	EnableVoiceBroadcast        bool   `json:"enableVoiceBroadcast"`
	OutboundPrepay              bool   `json:"outboundPrepay"`
	Enable247Dialing            bool   `json:"enable247Dialing"`
	EnableFifo                  bool   `json:"enableFifo"`
	EnableChat                  bool   `json:"enableChat"`
	EnableInbound               bool   `json:"enableInbound"`
	EnableOutbound              bool   `json:"enableOutbound"`
	EnableVisualIvr             bool   `json:"enableVisualIvr"`
	EnableTracking              bool   `json:"enableTracking"`
	EnableCloudRouting          bool   `json:"enableCloudRouting"`
	UsePowerBy                  bool   `json:"usePowerBy"`
	EnableAgentRankRouting      bool   `json:"enableAgentRankRouting"`
	EnableHciDialer             bool   `json:"enableHciDialer"`
	EnableTcpaSafeMachineDetect bool   `json:"enableTcpaSafeMachineDetect"`
	EmailFromAddress            string `json:"emailFromAddress"`
	DatabaseShardID             string `json:"databaseShardId"`
	DefaultOutdialServerGroupID int64  `json:"defaultOutdialServerGroupId"`
	DefaultIntellidialServerID  int64  `json:"defaultIntellidialServerId"`
	RcAccountAccess             string `json:"rcAccountAccess"`
	EnableGoodData              bool   `json:"enableGoodData"`
	MainAccountName             string `json:"mainAccountName"`
}

type ClientLite

type ClientLite struct {
	ServerURL  string
	Token      string
	AccountID  string
	HTTPClient *http.Client
}

func NewClientLite

func NewClientLite(serverURL, accountID, token string) ClientLite

func (*ClientLite) LoadHTTPClient

func (lite *ClientLite) LoadHTTPClient(token string)

func (*ClientLite) Tokens

func (lite *ClientLite) Tokens() ([]string, error)

type EngageCredentials

type EngageCredentials struct {
	Credentials credentials.Credentials
	EngageToken EngageToken
}

func NewEngageCredentialsJSON

func NewEngageCredentialsJSON(rcCredentialsJSON []byte) (EngageCredentials, error)

func (*EngageCredentials) LoadNewTokens

func (ec *EngageCredentials) LoadNewTokens() error

func (*EngageCredentials) NewClient

func (ec *EngageCredentials) NewClient() (*http.Client, error)

type EngageToken

type EngageToken struct {
	AccessToken string `json:"accessToken"`
	TokenType   string `json:"tokenType"`
}

func RcToEvToken

func RcToEvToken(rctoken string) (EngageToken, error)

type LoginError

type LoginError struct {
	GeneralMessage string `json:"generalMessage"`
	Details        string `json:"details"`
	RequestURI     string `json:"requestUri"`
	Timestamp      int64  `json:"timestamp"`
}

type LoginSuccess

type LoginSuccess struct {
	AuthToken    string    `json:"authToken"`
	PlatformHost string    `json:"platformHost"`
	Accounts     []Account `json:"accounts"`
}

func GenerateAPIToken

func GenerateAPIToken(username, password string) (string, *LoginSuccess, error)

type Role

type Role struct {
	RoleType    string `json:"roleType"`
	Description string `json:"description"`
}

type User

type User struct {
	UserID       int64     `json:"userId"`
	UserName     string    `json:"userName"`
	FirstName    string    `json:"firstName"`
	LastName     string    `json:"lastName"`
	FullName     string    `json:"fullName"`
	CreationDate time.Time `json:"creationDate"`
	Enabled      bool      `json:"enabled"`
	ParentPath   string    `json:"parentPath"`
	RcUserID     string    `json:"rcUserId"`
	Roles        []Role    `json:"roles"`
	RootUser     bool      `json:"rootUser"`
}

Jump to

Keyboard shortcuts

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