purecloud

package module
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: MIT Imports: 16 Imported by: 0

README

go-purecloud

GoVersion GoDoc License Report

A Package to send requests to HTTP/REST services.

PureCloud Client Library in GO

Have a look at the examples/ folder for complete examples on how to use this library.

Usage

You first start by creating a purecloud.Client that will allow to send requests to PureCloud:

Log    := logger.Create("purecloud")
client := purecloud.NewClient(&purecloud.ClientOptions{
	DeploymentID: "123abc0981234i0df8g0",
	Logger:       Log,
})

You can choose the authorization grant right away as well:

Log    := logger.Create("purecloud")
client := purecloud.NewClient(&purecloud.ClientOptions{
	DeploymentID: "123abc0981234i0df8g0",
	Logger:       Log,
}).SetAuthorizationGrant(&purecloud.AuthorizationCodeGrant{
	ClientID:    "hlkjshdgpiuy123387",
	Secret:      "879e8ugspojdgj",
	RedirectURL: "http://my.acme.com/token",
})

Or,

Log    := logger.Create("purecloud")
client := purecloud.NewClient(&purecloud.ClientOptions{
	DeploymentID: "123abc0981234i0df8g0",
	Logger:       Log,
}).SetAuthorizationGrant(&purecloud.ClientCredentialsGrant{
	ClientID: "jklsdufg89u9j234",
	Secret:   "sdfgjlskdfjglksdfjg",
})

As of today, Authorization Code and Client Credentials grants are implemented.

In the case of the Authorization Code, the best is to run a Webserver in your code and to handle the authentication requests in the router. The library provides two helpers to manage the authentication:

  • AuthorizeHandler() that can be used to ensure a page has an authenticated client,
  • LoggedInHandler() that can be used in the RedirectURL to process the results of the authentication.

They can be used like this (using the gorilla/mux router, for example):

router := mux.NewRouter()
// This is the main route of this application, we want a fully functional purecloud.Client
router.Methods("GET").Path("/").Handler(Client.AuthorizeHandler()(mainRouteHandler()))
// This route is used as the RedirectURL of the client
router.Methods("GET").Path("/token").Handler(Client.LoggedInHandler()(myhandler()))

In you HttpHandler, the client will be available from the request's context:

func mainRouteHandler() http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		client, err := purecloud.ClientFromContext(r.Context())
		if err != nil {
			core.RespondWithError(w, http.StatusServiceUnavailable, err)
			return
		}

		// Let's get my organization here, as an example...
		organization, err := client.GetMyOrganization()
		if err != nil {
			core.RespondWithError(w, http.StatusServiceUnavailable, err)
			return
		}
		core.RespondWithJSON(w, http.StatusOK, struct {
			OrgName  string `json:"organization"`
		}{
			OrgName:  organization.String(),
		})
	})
}

When using the Client Credential grant, you can configure the grant to tell when the token gets updated, allowing you to store it and re-use it in the future:

var TokenUpdateChan = make(chan purecloud.UpdatedAccessToken)

func main() {
	// ...
	defer close(TokenUpdateChan)

	go func() {
		for {
			data, opened := <-TokenUpdateChan

			if !opened {
				return
			}

			log.Printf("Received Token: %s\n", data.Token)

			myID, ok := data.CustomData.(string)
			if (!ok) {
				log.Printf("Shoot....\n")
			} else {
				log.Printf("myID: %s\n", myID)
			}
		}
	}()

	client := purecloud.NewClient(&purecloud.ClientOptions{
		// ...
	}).SetAuthorizationGrant(&purecloud.ClientCredentialsGrant{
		ClientID: "1234",
		Secret:   "s3cr3t",
		TokenUpdated: TokenUpdateChan,
		CustomData:   "myspecialID",
		Token: savedToken,
	})

	// do stuff with the client, etc.
}

As you can see, you can even pass some custom data (interface{}, so anything really) to the grant and that data will be passed back to the func that handles the chan.

Notifications

The PureCloud Notification API is accessible via the NotificationChannel and NotificationTopic types.

Here is a quick example:

user, err := client.GetMyUser()
if err != nil {
	log.Errorf("Failed to retrieve my User", err)
	panic(err)
}

notificationChannel, err := client.CreateNotificationChannel()
if err != nil {
	log.Errorf("Failed to create a notification channel", err)
	panic(err)
}

topics, err := config.NotificationChannel.Subscribe(
	purecloud.UserPresenceTopic{}.TopicFor(user),
)
if err != nil {
	log.Errorf("Failed to subscribe to topics", err)
	panic(err)
}
log.Infof("Subscribed to topics: [%s]", strings.Join(topics, ","))

// Call the PureCloud Notification Topic loop
go func() {
	for {
		select {
		case receivedTopic := notificationChannel.TopicReceived:
			if receivedTopic == nil {
				log.Infof("Terminating Topic message loop")
				return
			}
			switch topic := receivedTopic.(type) {
			case *purecloud.UserPresenceTopic:
				log.Infof("User %s, Presence: %s", topic.User, topic.Presence)
			default:
				log.Warnf("Unknown topic: %s", topic)
			}
		case <-time.After(30 * time.Second):
			// This timer makes sure the for loop does not execute too quickly 
			//   when no topic is received for a while
			log.Debugf("Nothing in the last 30 seconds")
		}
	}
}()

Agent Chat API

Guest Chat API

OpenMessaging API

TODO

This library implements only a very small set of PureCloud's API at the moment, but I keep adding stuff...

Documentation

Index

Constants

View Source
const APP string = "PureCloud Client"

APP is the name of the application

View Source
const ClientContextKey key = iota + 54329

ClientContextKey is the key to store Client in context.Context

Variables

View Source
var (
	// AuthenticationRequestTimeoutError means the request timed out
	AuthenticationRequestTimeoutError = APIError{Status: 504, Code: "authentication.request.timeout", Message: "Authentication request timeout."}
	// BadRequestError means the request was badly formed
	BadRequestError = APIError{Status: 400, Code: "bad.request", Message: "The request could not be understood by the server due to malformed syntax."}
	// InternalServerError means the server experiences an internal error
	InternalServerError = APIError{Status: 500, Code: "internal.server.error", Message: "The server encountered an unexpected condition which prevented it from fulfilling the request."}
	// InvalidDateError means the given date was invalid
	InvalidDateError = APIError{Status: 400, Code: "invalid.date", Message: "Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ"}
	// InvalidValueError means the value was invalid
	InvalidValueError = APIError{Status: 400, Code: "invalid.value", Message: "Value [%s] is not valid for field type [%s]. Allowable values are: %s"}
	// MissingAnyPermissionsError means the request was missing some permissions
	MissingAnyPermissionsError = APIError{Status: 403, Code: "missing.any.permissions", Message: "Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}
	// MissingPermissionsError means the request was missing some permissions
	MissingPermissionsError = APIError{Status: 403, Code: "missing.permissions", Message: "Unable to perform the requested action. You are missing the following permission(s): %s"}
	// NotAuthorizedError means the request was not authorized
	NotAuthorizedError = APIError{Status: 403, Code: "not.authorized", Message: "You are not authorized to perform the requested action."}
	// NotFoundError means the wanted resource was not found
	NotFoundError = APIError{Status: 404, Code: "not.found", Message: "The requested resource was not found."}
	// RequestTimeoutError means the request timed out
	RequestTimeoutError = APIError{Status: 504, Code: "request.timeout", Message: "The request timed out."}
	// ServiceUnavailableError means the service is not available
	ServiceUnavailableError = APIError{Status: 503, Code: "service.unavailable", Message: "Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}
	// TooManyRequestsError means the client sent too many requests and should wait before sending more
	TooManyRequestsError = APIError{Status: 429, Code: "too.many.requests", Message: "Rate limit exceeded the maximum [%s] requests within [%s] seconds"}
	// UnsupportedMediaTypeError means the media type is not supported
	UnsupportedMediaTypeError = APIError{Status: 415, Code: "unsupported.media.type", Message: "Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}

	// AuthenticationRequiredError means the request should authenticate first
	AuthenticationRequiredError = APIError{Status: 401, Code: "authentication.required", Message: "No authentication bearer token specified in authorization header."}
	// BadCredentialsError means the credentials are invalid
	BadCredentialsError = APIError{Status: 401, Code: "bad.credentials", Message: "Invalid login credentials."}
	// CredentialsExpiredError means the credentials are expired
	CredentialsExpiredError = APIError{Status: 401, Code: "credentials.expired", Message: "The supplied credentials are expired and cannot be used."}

	// ChatConversationStateError  means the conversation does not permit the request
	ChatConversationStateError = APIError{Status: 400, Code: "chat.error.conversation.state", Message: "The conversation is in a state which does not permit this action."}
	// ChatMemberStateError means the chat member does not permit the request
	ChatMemberStateError = APIError{Status: 400, Code: "chat.error.member.state", Message: "The conversation member is in a state which does not permit this action."}
	// ChatDeploymentBadAuthError means the authentication failed
	ChatDeploymentBadAuthError = APIError{Status: 400, Code: "chat.deployment.bad.auth", Message: "The customer member authentication has failed."}
	// ChatDeploymentDisabledError means the deployment is disabled
	ChatDeploymentDisabledError = APIError{Status: 400, Code: "chat.deployment.disabled", Message: "The web chat deployment is currently disabled."}
	// ChatDeploymentRequireAuth means the deployment requires some authentication
	ChatDeploymentRequireAuth = APIError{Status: 400, Code: "chat.deployment.require.auth", Message: "The deployment requires the customer member to be authenticated."}
	// ChatInvalidQueueError means the queue is not valid
	ChatInvalidQueueError = APIError{Status: 400, Code: "chat.error.invalid.queue", Message: "The specified queue is not valid."}
	// ChatCreateConversationRequestRoutingTargetError means the routing target is not valid
	ChatCreateConversationRequestRoutingTargetError = APIError{Status: 400, Code: "chat.error.createconversationrequest.routingtarget", Message: "The routing target is not valid."}
)
View Source
var VERSION = "0.3.2" + commit

VERSION is the version of this application

Functions

func Contains added in v0.2.1

func Contains(value string, values []string) bool

Types

type ACWSettings added in v0.1.0

type ACWSettings struct {
	WrapupPrompt string
	Timeout      time.Duration
}

ACWSettings defines the After Call Work settings of a Queue

func (ACWSettings) MarshalJSON added in v0.1.0

func (settings ACWSettings) MarshalJSON() ([]byte, error)

MarshalJSON marshals this into JSON

func (*ACWSettings) UnmarshalJSON added in v0.1.0

func (settings *ACWSettings) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

type APIError added in v0.0.2

type APIError struct {
	Status            int               `json:"status,omitempty"`
	Code              string            `json:"code,omitempty"`
	Message           string            `json:"message,omitempty"`
	MessageParams     map[string]string `json:"messageParams,omitempty"`
	MessageWithParams string            `json:"messageWithParams,omitempty"`
	EntityID          string            `json:"entityId,omitempty"`
	EntityName        string            `json:"entityName,omitempty"`
	ContextID         string            `json:"contextId,omitempty"`
	CorrelationID     string            `json:"correlationId,omitempty"`
	Details           []APIErrorDetails `json:"details,omitempty"`
	Errors            []APIError        `json:"errors,omitempty"`
}

APIError represents an error from the PureCloud API

func (APIError) Error added in v0.0.2

func (e APIError) Error() string

Error returns a string representation of this error

func (*APIError) UnmarshalJSON added in v0.0.2

func (e *APIError) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON decodes a JSON payload into an APIError

type APIErrorDetails added in v0.0.2

type APIErrorDetails struct {
	ErrorCode  string `json:"errorCode,omitempty"`
	FieldName  string `json:"fieldName,omitempty"`
	EntityID   string `json:"entityId,omitempty"`
	EntityName string `json:"entityName,omitempty"`
}

APIErrorDetails contains the details of an APIError

type AccessToken added in v0.1.0

type AccessToken struct {
	Type      string    `json:"tokenType"`
	Token     string    `json:"token"`
	ExpiresOn time.Time `json:"tokenExpires"` // UTC!
}

AccessToken is used to consume the PureCloud API

It must be obtained via an AuthorizationGrant

func (AccessToken) ExpiresIn added in v0.1.0

func (token AccessToken) ExpiresIn() time.Duration

ExpiresIn tells when the token should expire

func (AccessToken) IsExpired added in v0.1.0

func (token AccessToken) IsExpired() bool

IsExpired tells if this AccessToken is expired or not

func (AccessToken) IsValid added in v0.1.0

func (token AccessToken) IsValid() bool

IsValid tells if this AccessToken is valid

func (*AccessToken) LoadFromCookie added in v0.1.0

func (token *AccessToken) LoadFromCookie(r *http.Request, cookieName string) *AccessToken

LoadFromCookie loads this token from a cookie in the given HTTP Request

func (*AccessToken) Reset added in v0.1.0

func (token *AccessToken) Reset()

Reset resets the Token so it is expired and empty

func (AccessToken) SaveToCookie added in v0.1.0

func (token AccessToken) SaveToCookie(w http.ResponseWriter, cookieName string)

SaveToCookie saves this token to a cookie in the given HTTP ResponseWriter

func (AccessToken) String added in v0.1.0

func (token AccessToken) String() string

type Address added in v0.1.0

type Address struct {
	Name               string `json:"name"`
	NameRaw            string `json:"nameRaw"`
	AddressDisplayable string `json:"addressDisplayable"`
	AddressRaw         string `json:"addressRaw"`
	AddressNormalized  string `json:"addressNormalized"`
}

Address describes an Address (telno, etc)

type Addressable added in v0.1.0

type Addressable interface {
	GetURI() URI
}

Addressable describes things that carry a URI (typically /api/v2/things/{{uuid}})

type AddressableEntityRef added in v0.1.0

type AddressableEntityRef struct {
	ID      uuid.UUID `json:"id"`
	SelfURI string    `json:"selfUri,omitempty"`
}

AddressableEntityRef describes an Entity that can be addressed

func (AddressableEntityRef) GetID added in v0.1.0

func (ref AddressableEntityRef) GetID() uuid.UUID

GetID gets the identifier of this

implements Identifiable

func (AddressableEntityRef) GetURI added in v0.1.0

func (ref AddressableEntityRef) GetURI() string

GetURI gets the URI of this

implements Addressable

type AgentlessMessage added in v0.2.0

type AgentlessMessage struct {
	From          string             `json:"fromAddress"`
	To            string             `json:"toAddress"`
	MessengerType string             `json:"toAddressMessengerType"`
	Text          string             `json:"textBody"`
	Template      *MessagingTemplate `json:"messagingTemplate,omitempty"`
}

AgentlessMessage sends an agentless outbound text message to a Messenger address

See https://developer.genesys.cloud/api/rest/v2/conversations/#post-api-v2-conversations-messages-agentless

type AgentlessMessageResult added in v0.2.0

type AgentlessMessageResult struct {
	ID             string                `json:"id"`
	ConversationID uuid.UUID             `json:"conversationId"`
	From           string                `json:"fromAddress"`
	To             string                `json:"toAddress"`
	MessengerType  string                `json:"messengerType"`
	Text           string                `json:"textBody"`
	Template       *MessagingTemplate    `json:"messagingTemplate,omitempty"`
	JobUser        *AddressableEntityRef `json:"user,omitempty"`
	Timestamp      time.Time             `json:"timestamp"`
	SelfURI        string                `json:"selfUri"`
}

AgentlessMessageResult describes the results of the send action on an AgentlessMessage

type AnswerOption added in v0.1.0

type AnswerOption struct {
	ID    uuid.UUID `json:"id"`
	Text  string    `json:"text"`
	Value int       `json:"value"`
}

AnswerOption describes an Answer Option

type Attachment added in v0.1.0

type Attachment struct {
	AttachmentID  string `json:"attachmentId"`
	Name          string `json:"name"`
	ContentURI    string `json:"contentUri"`
	ContentType   string `json:"contentType"`
	ContentLength int64  `json:"contentLength"`
	InlineImage   bool   `json:"inlineImage"`
}

Attachment describes an Email Attachment

type Authorization

type Authorization struct {
	ClientID     string    `json:"clientId"`
	Secret       string    `json:"clientSecret"`
	RedirectURI  *url.URL  `json:"redirectUri"`
	TokenType    string    `json:"tokenType"`
	Token        string    `json:"token"`
	TokenExpires time.Time `json:"tokenExpires"`
}

Authorization contains the login options to connect the client to PureCloud

type AuthorizationCodeGrant added in v0.1.0

type AuthorizationCodeGrant struct {
	ClientID     uuid.UUID
	Secret       string
	Code         string
	RedirectURL  *url.URL
	Token        AccessToken
	CustomData   interface{}
	TokenUpdated chan UpdatedAccessToken
}

AuthorizationCodeGrant implements PureCloud's Client Authorization Code Grants

See: https://developer.mypurecloud.com/api/rest/authorization/use-authorization-code.html

func (*AuthorizationCodeGrant) AccessToken added in v0.1.0

func (grant *AuthorizationCodeGrant) AccessToken() *AccessToken

AccessToken gives the access Token carried by this Grant

func (*AuthorizationCodeGrant) Authorize added in v0.1.0

func (grant *AuthorizationCodeGrant) Authorize(client *Client) (err error)

Authorize this Grant with PureCloud

func (*AuthorizationCodeGrant) GetID added in v0.3.2

func (grant *AuthorizationCodeGrant) GetID() uuid.UUID

GetID gets the client Identifier

Implements core.Identifiable

type AuthorizationDivision added in v0.3.2

type AuthorizationDivision struct {
	ID           uuid.UUID      `json:"id"`
	SelfUri      string         `json:"selfUri"`
	Name         string         `json:"name"`
	Description  string         `json:"description"` // required
	IsHome       bool           `json:"homeDivision"`
	ObjectCounts map[string]int `json:"objectCounts"`
}

func (AuthorizationDivision) GetID added in v0.3.2

func (division AuthorizationDivision) GetID() uuid.UUID

GetID gets the identifier

implements core.Identifiable

type AuthorizationGrant added in v0.1.0

type AuthorizationGrant struct {
	SubjectID uuid.UUID              `json:"subjectId"`
	Division  AuthorizationDivision  `json:"division"`
	Role      AuthorizationGrantRole `json:"role"`
	CreatedAt string                 `json:"grantMadeAt"` // TODO: this is an ISO8601 date
}

type AuthorizationGrantPolicy added in v0.3.2

type AuthorizationGrantPolicy struct {
	EntityName string   `json:"entityName"`
	Domain     string   `json:"domain"`
	Condition  string   `json:"condition"`
	Actions    []string `json:"actions"`
}

type AuthorizationGrantRole added in v0.3.2

type AuthorizationGrantRole struct {
	ID          uuid.UUID                  `json:"id"`
	SelfUri     string                     `json:"selfUri"`
	Name        string                     `json:"name"`
	Description string                     `json:"description"`
	IsDefault   bool                       `json:"default"`
	Policies    []AuthorizationGrantPolicy `json:"policies"`
}

func (AuthorizationGrantRole) GetID added in v0.3.2

func (role AuthorizationGrantRole) GetID() uuid.UUID

GetID gets the identifier

implements core.Identifiable

type AuthorizationSubject added in v0.3.2

type AuthorizationSubject struct {
	ID      uuid.UUID            `json:"id"`
	SelfUri string               `json:"selfUri"`
	Name    string               `json:"name"`
	Grants  []AuthorizationGrant `json:"grants"`
	Version int                  `json:"version"`
}

AuthorizationSubject describes the roles and permissions of a Subject

func (AuthorizationSubject) GetID added in v0.3.2

func (subject AuthorizationSubject) GetID() uuid.UUID

GetID gets the identifier

implements core.Identifiable

type Authorizer added in v0.3.2

type Authorizer interface {
	Authorize(client *Client) error // Authorize a client with PureCloud
	AccessToken() *AccessToken      // Get the Access Token obtained by the Authorizer
	core.Identifiable               // Implements core.Identifiable
}

Authorizer describes what a grants should do

type Biography added in v0.1.0

type Biography struct {
	Biography string   `json:"biography"`
	Interests []string `json:"interests"`
	Hobbies   []string `json:"hobbies"`
	Spouse    string   `json:"spouse"`
}

Biography describes a User's biography

type Calibration added in v0.1.0

type Calibration struct {
	ID              uuid.UUID       `json:"id"`
	Name            string          `json:"name"`
	SelfUri         string          `json:"selfUri"`
	Calibrator      *User           `json:"calibrator"`
	Agent           *User           `json:"agent"`
	Conversation    *Conversation   `json:"conversation"`
	EvaluationForm  *EvaluationForm `json:"evaluationForm"`
	ContextID       string          `json:"contextId"`
	AverageScore    int             `json:"averageScore"`
	HighScore       int             `json:"highScore"`
	LowScore        int             `json:"lowScore"`
	CreatedDate     time.Time       `json:"createdDate"`
	Evaluations     []*Evaluation   `json:"evaluations"`
	Evaluators      []*User         `json:"evaluators"`
	ScoringIndex    *Evaluation     `json:"scoringIndex"`
	ExpertEvaluator *User           `json:"expertEvaluator"`
}

Calibration describe a Calibration

type ChannelTopic added in v0.2.0

type ChannelTopic struct {
	ID      string `json:"id"` // ID is a string of the form v2.xxx.uuuid.yyy
	SelfURI string `json:"selfUri,omitempty"`
}

ChannelTopic describes a Topic subscription channel

See https://developer.genesys.cloud/api/rest/v2/notifications/notification_service#topic-subscriptions

type ChatMember added in v0.1.0

type ChatMember struct {
	ID            uuid.UUID         `json:"id,omitempty"`
	DisplayName   string            `json:"displayName,omitempty"`
	AvatarURL     *url.URL          `json:"-"`
	Role          string            `json:"role,omitempty"`
	State         string            `json:"state,omitempty"`
	JoinedAt      time.Time         `json:"joinDate,omitempty"`
	LeftAt        time.Time         `json:"leaveDate,omitempty"`
	Authenticated bool              `json:"authenticatedGuest,omitempty"`
	Custom        map[string]string `json:"customFields,omitempty"`
}

ChatMember describes a Chat Member

func (ChatMember) GetID added in v0.1.0

func (member ChatMember) GetID() uuid.UUID

GetID gets the identifier of this

implements Identifiable

func (ChatMember) MarshalJSON added in v0.1.0

func (member ChatMember) MarshalJSON() ([]byte, error)

MarshalJSON marshals this into JSON

func (ChatMember) String added in v0.1.0

func (member ChatMember) String() string

String gets a string version

implements the fmt.Stringer interface

func (*ChatMember) UnmarshalJSON added in v0.1.0

func (member *ChatMember) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

type Client

type Client struct {
	Region         string         `json:"region"`
	DeploymentID   uuid.UUID      `json:"deploymentId"`
	Organization   *Organization  `json:"-"`
	API            *url.URL       `json:"apiUrl,omitempty"`
	LoginURL       *url.URL       `json:"loginUrl,omitempty"`
	Proxy          *url.URL       `json:"proxyUrl,omitempty"`
	Grant          Authorizer     `json:"-"`
	RequestTimeout time.Duration  `json:"requestTimout"`
	Logger         *logger.Logger `json:"-"`
}

Client is the primary object to use PureCloud

func ClientFromContext added in v0.1.0

func ClientFromContext(context context.Context) (*Client, error)

ClientFromContext retrieves a Client from a context

func NewClient added in v0.1.0

func NewClient(options *ClientOptions) *Client

NewClient creates a new PureCloud Client

func (*Client) AuthorizeHandler added in v0.1.0

func (client *Client) AuthorizeHandler() func(http.Handler) http.Handler

AuthorizeHandler validates an incoming Request and sends to PureCloud Authorize process if not

func (*Client) CheckPermissions added in v0.3.2

func (client *Client) CheckPermissions(permissions ...string) (permitted []string, missing []string)

func (*Client) CreateNotificationChannel added in v0.1.0

func (client *Client) CreateNotificationChannel() (*NotificationChannel, error)

CreateNotificationChannel creates a new channel for notifications

If the environment variable PURECLOUD_LOG_HEARTBEAT is set to true, the Heartbeat topic will be logged

func (*Client) Delete

func (client *Client) Delete(path URI, results interface{}) error

Delete sends a DELETE HTTP Request to PureCloud and gets the results

func (*Client) DeleteCookie added in v0.1.0

func (client *Client) DeleteCookie(w http.ResponseWriter)

DeleteCookie deletes the PureCloud Client cookie from the response writer

func (*Client) Fetch added in v0.1.0

func (client *Client) Fetch(object Initializable) error

Fetch fetches an initializable object

func (*Client) FetchRolesAndPermissions added in v0.3.2

func (client *Client) FetchRolesAndPermissions() (*AuthorizationSubject, error)

FetchRolesAndPermissions fetches roles and permissions for the current client

func (*Client) FetchRolesAndPermissionsOf added in v0.3.2

func (client *Client) FetchRolesAndPermissionsOf(id core.Identifiable) (*AuthorizationSubject, error)

FetchRolesAndPermissions fetches roles and permissions for the current client

func (*Client) FindQueueByName added in v0.1.0

func (client *Client) FindQueueByName(name string) (*Queue, error)

FindQueueByName finds a Queue by its name

func (*Client) Get

func (client *Client) Get(path URI, results interface{}) error

Get sends a GET HTTP Request to PureCloud and gets the results

func (*Client) GetMyOrganization

func (client *Client) GetMyOrganization() (*Organization, error)

GetMyOrganization retrives the current Organization

func (*Client) GetMyUser added in v0.1.0

func (client *Client) GetMyUser(properties ...string) (*User, error)

GetMyUser retrieves the User that authenticated with the client

properties is one of more properties that should be expanded
see https://developer.mypurecloud.com/api/rest/v2/users/#get-api-v2-users-me

func (*Client) GetNotificationAvailableTopics added in v0.1.0

func (client *Client) GetNotificationAvailableTopics(properties ...string) ([]NotificationTopicDefinition, error)

GetNotificationAvailableTopics retrieves available notification topics

properties is one of more properties that should be expanded
see https://developer.mypurecloud.com/api/rest/v2/notifications/#get-api-v2-notifications-availabletopics

func (*Client) HttpHandler added in v0.1.0

func (client *Client) HttpHandler() func(http.Handler) http.Handler

HttpHandler wraps the client into an http Handler

func (*Client) IsAuthorized

func (client *Client) IsAuthorized() bool

IsAuthorized tells if the client has an Authorization Token It migt be expired and the app should login again as needed

func (*Client) LoggedInHandler added in v0.1.0

func (client *Client) LoggedInHandler() func(http.Handler) http.Handler

LoggedInHandler gets a valid Token from PureCloud using an AuthorizationGrant

func (*Client) Login

func (client *Client) Login() error

Login logs in a Client to PureCloud

Uses the credentials stored in the Client

func (*Client) LoginWithAuthorizationGrant added in v0.1.0

func (client *Client) LoginWithAuthorizationGrant(grant Authorizer) (err error)

LoginWithAuthorizationGrant logs in a Client to PureCloud with given authorization Grant

func (*Client) Logout

func (client *Client) Logout()

Logout logs out a Client from PureCloud

func (*Client) LogoutHandler added in v0.1.0

func (client *Client) LogoutHandler() func(http.Handler) http.Handler

LogoutHandler logs out the current user

func (*Client) Patch added in v0.1.0

func (client *Client) Patch(path URI, payload, results interface{}) error

Patch sends a PATCH HTTP Request to PureCloud and gets the results

func (*Client) Post

func (client *Client) Post(path URI, payload, results interface{}) error

Post sends a POST HTTP Request to PureCloud and gets the results

func (*Client) Put added in v0.1.0

func (client *Client) Put(path URI, payload, results interface{}) error

Put sends an UPDATE HTTP Request to PureCloud and gets the results

func (*Client) SendRequest added in v0.1.0

func (client *Client) SendRequest(path URI, options *request.Options, results interface{}) (err error)

SendRequest sends a REST request to PureCloud

func (*Client) SetAuthorizationGrant added in v0.1.0

func (client *Client) SetAuthorizationGrant(grant Authorizer) *Client

SetAuthorizationGrant sets the Authorization Grant

func (*Client) SetLogger

func (client *Client) SetLogger(log *logger.Logger) *Client

SetLogger sets the logger

func (*Client) SetRegion

func (client *Client) SetRegion(region string) *Client

SetRegion sets the region and its main API

func (*Client) ToContext added in v0.1.0

func (client *Client) ToContext(parent context.Context) context.Context

ToContext stores this Client in the given context

type ClientCredentialsGrant added in v0.1.0

type ClientCredentialsGrant struct {
	ClientID     uuid.UUID
	Secret       string
	Token        AccessToken
	CustomData   interface{}
	TokenUpdated chan UpdatedAccessToken
}

ClientCredentialsGrant implements PureCloud's Client Credentials Grants

When the Token is updated, the new token is sent to the TokenUpdated chan along with the CustomData

See: https://developer.mypurecloud.com/api/rest/authorization/use-client-credentials.html

func (*ClientCredentialsGrant) AccessToken added in v0.1.0

func (grant *ClientCredentialsGrant) AccessToken() *AccessToken

AccessToken gives the access Token carried by this Grant

func (*ClientCredentialsGrant) Authorize added in v0.1.0

func (grant *ClientCredentialsGrant) Authorize(client *Client) (err error)

Authorize this Grant with PureCloud

func (*ClientCredentialsGrant) GetID added in v0.3.2

func (grant *ClientCredentialsGrant) GetID() uuid.UUID

GetID gets the client Identifier

Implements core.Identifiable

type ClientOptions

type ClientOptions struct {
	Region         string
	OrganizationID uuid.UUID
	DeploymentID   uuid.UUID
	Proxy          *url.URL
	Grant          Authorizer
	RequestTimeout time.Duration
	Logger         *logger.Logger
}

ClientOptions contains the options to create a new Client

type CobrowseSession added in v0.1.0

type CobrowseSession struct {
	ID    uuid.UUID `json:"id"`
	State string    `json:"state"` // alerting,dialing,contacting,offering,connected,disconnected,terminated,converting,uploading,transmitting,scheduled,none
	Self  Address   `json:"self"`
	Held  bool      `json:"held"`

	ProviderEventTime time.Time `json:"providerEventTime"`
	ConnectedTime     time.Time `json:"connectedTime"`
	DisconnectedTime  time.Time `json:"disconnectedTime"`
	StartAlertingTime time.Time `json:"startAlertingTime"`

	DisconnectType string `json:"disconnectType"` // endpoint,client,system,transfer,timeout,transfer.conference,transfer.consult,transfer.forward,transfer.noanswer,transfer.notavailable,transport.failure,error,peer,other,spam,uncallable

	Segments          []Segment `json:"segments"`
	Provider          string    `json:"provider"`
	PeerID            string    `json:"peerId"`
	CobrowseSessionID string    `json:"cobrowseSessionId"`
	CobrowseRole      string    `json:"cobrowseRole"`
	Controlling       []string  `json:"controlling"`
	ViewerURL         *url.URL  `json:"viewerUrl"`
}

CobrowseSession describes a Cobrowse Session (like belonging to Participant)

func (CobrowseSession) GetID added in v0.1.0

func (session CobrowseSession) GetID() uuid.UUID

GetID gets the identifier of this

implements Identifiable

func (CobrowseSession) String added in v0.1.0

func (session CobrowseSession) String() string

String gets a string version

implements the fmt.Stringer interface

type Contact added in v0.1.0

type Contact struct {
	Type      string `json:"type"`      // PRIMARY, WORK, WORK2, WORK3, WORK4, HOME, MOBILE, MAIN
	MediaType string `json:"mediaType"` // PHONE, EMAIL, SMS
	Display   string `json:"display,omitempty"`
	Address   string `json:"address,omitempty"`   // If present, there is no Extension
	Extension string `json:"extension,omitempty"` // If present, there is no Address
}

Contact describes something that can be contacted

func (Contact) String added in v0.1.0

func (contact Contact) String() string

String gets a string version

implements the fmt.Stringer interface

type Conversation added in v0.1.0

type Conversation struct {
	ID              uuid.UUID      `json:"id"`
	SelfURI         string         `json:"selfUri,omitempty"`
	Name            string         `json:"name"`
	StartTime       time.Time      `json:"startTime"`
	EndTime         time.Time      `json:"endTime"`
	Address         string         `json:"address"`
	Participants    []*Participant `json:"participants"`
	ConversationIDs []uuid.UUID    `json:"conversationIds"`
	MaxParticipants int            `json:"maxParticipants"`
	RecordingState  string         `json:"recordingState"`
	State           string         `json:"state"`
	Divisions       []struct {
		Division DomainEntityRef   `json:"division"`
		Entities []DomainEntityRef `json:"entities"`
	} `json:"divisions"`

	Client *Client        `json:"-"`
	Logger *logger.Logger `json:"-"`
}

Conversation contains the details of a live conversation

See: https://developer.mypurecloud.com/api/rest/v2/conversations

func (Conversation) GetID added in v0.1.0

func (conversation Conversation) GetID() uuid.UUID

GetID gets the identifier of this

implements Identifiable

func (*Conversation) Initialize added in v0.1.0

func (conversation *Conversation) Initialize(parameters ...interface{}) error

Initialize initializes this from the given Client

implements Initializable

func (Conversation) String added in v0.1.0

func (conversation Conversation) String() string

String gets a string version

implements the fmt.Stringer interface

type ConversationCall added in v0.1.0

type ConversationCall struct {
	ID                uuid.UUID           `json:"id"`
	Self              *Address            `json:"self"`
	Direction         string              `json:"direction"` // inbound,outbound
	State             string              `json:"state"`     // alerting,dialing,contacting,offering,connected,disconnected,terminated,converting,uploading,transmitting,scheduled,none
	Muted             bool                `json:"muted"`
	Held              bool                `json:"held"`
	Confined          bool                `json:"confined"`
	Recording         bool                `json:"recording"`
	RecordingState    string              `json:"recodingState"` // none,active,paused
	RecordingID       string              `json:"recordingId"`
	Segments          []Segment           `json:"segments"`
	DocumentID        string              `json:"documentId"`
	Provider          string              `json:"provider"`
	ScriptID          string              `json:"scriptId"`
	PeerID            string              `json:"peerId"`
	UUIData           string              `json:"uuiData"`
	Other             *Address            `json:"other"`
	ConnectedTime     time.Time           `json:"connectedTime"`
	DisconnectedTime  time.Time           `json:"disconnectedTime"`
	StartAlertingTime time.Time           `json:"startAlertingTime"`
	StartHoldTime     time.Time           `json:"startHoldTime"`
	DisconnectType    string              `json:"disconnectType"` // endpoint,client,system,transfer,timeout,transfer.conference,transfer.consult,transfer.forward,transfer.noanswer,transfer.notavailable,transport.failure,error,peer,other,spam,uncallable
	DisconnectReasons []*DisconnectReason `json:"disconnectReasons"`
	FaxStatus         FaxStatus           `json:"faxStatus"`
	ErrorInfo         ErrorBody           `json:"errorInfo"`
}

ConversationCall describes a Call (like belonging to Participant)

type ConversationCallback added in v0.1.0

type ConversationCallback struct {
	ID        uuid.UUID `json:"id"`
	State     string    `json:"state"`     // alerting,dialing,contacting,offering,connected,disconnected,terminated,converting,uploading,transmitting,scheduled,none
	Direction string    `json:"direction"` // inbound,outbound
	Held      bool      `json:"held"`

	ConnectedTime     time.Time `json:"connectedTime"`
	DisconnectedTime  time.Time `json:"disconnectedTime"`
	StartAlertingTime time.Time `json:"startAlertingTime"`
	StartHoldTime     time.Time `json:"startHoldTime"`
	ScheduledTime     time.Time `json:"callbackScheduledTime"`

	DisconnectType string `json:"disconnectType"` // endpoint,client,system,transfer,timeout,transfer.conference,transfer.consult,transfer.forward,transfer.noanswer,transfer.notavailable,transport.failure,error,peer,other,spam,uncallable

	Segments                  []Segment      `json:"segments"`
	Provider                  string         `json:"provider"`
	PeerID                    string         `json:"peerId"`
	DialerPreview             *DialerPreview `json:"dialerPreview"`
	Voicemail                 *Voicemail     `json:"voicemail"`
	CallbackNumbers           []string       `json:"callbackNumbers"`
	CallbackUserName          string         `json:"callbackUserName"`
	ScriptID                  string         `json:"scriptId"`
	AutomatedCallbackConfigID string         `json:"automatedCallbackConfigId"`
}

ConversationCallback describes a Callback (like belonging to Participant)

type ConversationChat added in v0.1.0

type ConversationChat struct {
	ID                uuid.UUID       `json:"id"`
	SelfURI           string          `json:"selfUri,omitempty"`
	State             string          `json:"state"`          // alerting,dialing,contacting,offering,connected,disconnected,terminated,converting,uploading,transmitting,scheduled,none
	Direction         string          `json:"direction"`      // inbound,outbound
	DisconnectType    string          `json:"disconnectType"` // endpoint,client,system,transfer,timeout,transfer.conference,transfer.consult,transfer.forward,transfer.noanswer,transfer.notavailable,transport.failure,error,peer,other,spam,uncallable
	Held              bool            `json:"held"`
	ConnectedTime     time.Time       `json:"connectedTime"`
	DisconnectedTime  time.Time       `json:"disconnectedTime"`
	StartAlertingTime time.Time       `json:"startAlertingTime"`
	StartHoldTime     time.Time       `json:"startHoldTime"`
	Participants      []*Participant  `json:"participants"`
	Segments          []Segment       `json:"segments"`
	Provider          string          `json:"provider"`
	PeerID            string          `json:"peerId"`
	RoomID            string          `json:"roomId"`
	ScriptID          string          `json:"scriptId"`
	RecordingID       string          `json:"recordingId"`
	AvatarImageURL    *url.URL        `json:"-"`
	JourneyContext    *JourneyContext `json:"journeyContext"`
	Client            *Client         `json:"-"`
	Logger            *logger.Logger  `json:"-"`
}

ConversationChat describes a Agent-side Chat

func (ConversationChat) Disconnect added in v0.1.0

func (conversation ConversationChat) Disconnect(identifiable Identifiable) error

Disconnect disconnect an Identifiable from this

implements Disconnecter

func (ConversationChat) GetID added in v0.1.0

func (conversation ConversationChat) GetID() uuid.UUID

GetID gets the identifier of this

implements Identifiable

func (*ConversationChat) Initialize added in v0.1.0

func (conversation *ConversationChat) Initialize(parameters ...interface{}) error

Initialize initializes this from the given Client

implements Initializable

func (ConversationChat) Post added in v0.1.0

func (conversation ConversationChat) Post(member Identifiable, text string) error

Post sends a text message to a chat member

func (ConversationChat) SetTyping added in v0.1.0

func (conversation ConversationChat) SetTyping(member Identifiable) error

SetTyping send a typing indicator to the chat member

func (ConversationChat) String added in v0.1.0

func (conversation ConversationChat) String() string

String gets a string version

implements the fmt.Stringer interface

func (ConversationChat) Transfer added in v0.1.0

func (conversation ConversationChat) Transfer(identifiable Identifiable, queue Identifiable) error

Transfer transfers a participant of this Conversation to the given Queue

implement Transferrer

func (*ConversationChat) UnmarshalJSON added in v0.1.0

func (conversation *ConversationChat) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

func (ConversationChat) UpdateState added in v0.1.0

func (conversation ConversationChat) UpdateState(identifiable Identifiable, state string) error

UpdateState update the state of an identifiable in this

implements StateUpdater

func (ConversationChat) Wrapup added in v0.1.0

func (conversation ConversationChat) Wrapup(identifiable Identifiable, wrapup *Wrapup) error

Wrapup wraps up a Participant of this Conversation

type ConversationChatMessageTopic added in v0.1.0

type ConversationChatMessageTopic struct {
	ID            uuid.UUID
	Name          string
	Conversation  *ConversationChat
	Sender        *ChatMember
	Type          string // message, typing-indicator,
	Body          string
	BodyType      string // standard,
	TimeStamp     time.Time
	CorrelationID string
	Client        *Client
}

ConversationChatMessageTopic describes a Topic about User's Presence

func (*ConversationChatMessageTopic) GetClient added in v0.1.0

func (topic *ConversationChatMessageTopic) GetClient() *Client

GetClient gets the PureCloud Client associated with this

func (ConversationChatMessageTopic) Match added in v0.1.0

func (topic ConversationChatMessageTopic) Match(topicName string) bool

Match tells if the given topicName matches this topic

func (*ConversationChatMessageTopic) Send added in v0.1.0

func (topic *ConversationChatMessageTopic) Send(channel *NotificationChannel)

Send sends the current topic to the Channel's chan

func (ConversationChatMessageTopic) String added in v0.1.0

func (topic ConversationChatMessageTopic) String() string

String gets a string version

implements the fmt.Stringer interface

func (ConversationChatMessageTopic) TopicFor added in v0.1.0

func (topic ConversationChatMessageTopic) TopicFor(identifiables ...Identifiable) string

TopicFor builds the topicName for the given identifiables

func (*ConversationChatMessageTopic) UnmarshalJSON added in v0.1.0

func (topic *ConversationChatMessageTopic) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

type ConversationEmail added in v0.1.0

type ConversationEmail struct {
	ID                uuid.UUID     `json:"id"`
	State             string        `json:"state"`     // alerting,dialing,contacting,offering,connected,disconnected,terminated,converting,uploading,transmitting,scheduled,none
	Direction         string        `json:"direction"` // inbound,outbound
	Held              bool          `json:"held"`
	ConnectedTime     time.Time     `json:"connectedTime"`
	DisconnectedTime  time.Time     `json:"disconnectedTime"`
	StartAlertingTime time.Time     `json:"startAlertingTime"`
	StartHoldTime     time.Time     `json:"startHoldTime"`
	Segments          []Segment     `json:"segments"`
	Provider          string        `json:"provider"`
	ScriptID          string        `json:"scriptId"`
	PeerID            string        `json:"peerId"`
	RecordingID       string        `json:"recordingId"`
	AutoGenerated     bool          `json:"autoGenerated"`
	Subject           string        `json:"subject"`
	MessagesSent      int           `json:"messagesSent"`
	MessageID         string        `json:"messageId"`
	Spam              bool          `json:"spam"`
	DraftAttachments  []*Attachment `json:"draftAttachments"`
	DisconnectType    string        `json:"disconnectType"` // endpoint,client,system,transfer,timeout,transfer.conference,transfer.consult,transfer.forward,transfer.noanswer,transfer.notavailable,transport.failure,error,peer,other,spam,uncallable
	ErrorInfo         ErrorBody     `json:"errorInfo"`
}

ConversationEmail describes an Email (like belonging to Participant)

type ConversationGuestChat added in v0.1.0

type ConversationGuestChat struct {
	ID            uuid.UUID                 `json:"id"`
	SelfURI       string                    `json:"selfUri,omitempty"`
	Target        *RoutingTarget            `json:"-"`
	Guest         *ChatMember               `json:"member,omitempty"`
	Members       map[uuid.UUID]*ChatMember `json:"-"`
	JWT           string                    `json:"jwt,omitempty"`
	EventStream   string                    `json:"eventStreamUri,omitempty"`
	Socket        *websocket.Conn           `json:"-"`
	TopicReceived chan NotificationTopic    `json:"-"`
	LogHeartbeat  bool                      `json:"logHeartbeat"`
	Client        *Client                   `json:"-"`
	Logger        *logger.Logger            `json:"-"`
}

ConversationGuestChat describes a Guest Chat

func (*ConversationGuestChat) Close added in v0.1.0

func (conversation *ConversationGuestChat) Close() (err error)

Close disconnects the websocket and the guest

func (*ConversationGuestChat) Connect added in v0.1.0

func (conversation *ConversationGuestChat) Connect() (err error)

Connect connects a Guest Chat to its websocket and starts its message loop

If the websocket was already connected, nothing happens
If the environment variable PURECLOUD_LOG_HEARTBEAT is set to true, the Heartbeat topic will be logged

func (ConversationGuestChat) GetID added in v0.1.0

func (conversation ConversationGuestChat) GetID() uuid.UUID

GetID gets the identifier of this

implements Identifiable

func (*ConversationGuestChat) GetMember added in v0.1.0

func (conversation *ConversationGuestChat) GetMember(identifiable Identifiable) (*ChatMember, error)

GetMember fetches the given member of this Conversation (caches the member)

func (*ConversationGuestChat) Initialize added in v0.1.0

func (conversation *ConversationGuestChat) Initialize(parameters ...interface{}) (err error)

Initialize initializes this from the given Client

implements Initializable

func (*ConversationGuestChat) SendMessage added in v0.1.0

func (conversation *ConversationGuestChat) SendMessage(text string) (err error)

SendMessage sends a message as the chat guest

func (*ConversationGuestChat) SendNotice added in v0.1.0

func (conversation *ConversationGuestChat) SendNotice(text string) (err error)

SendNotice sends a notice as the chat guest

func (*ConversationGuestChat) SendTyping added in v0.1.0

func (conversation *ConversationGuestChat) SendTyping() (err error)

SendTyping sends a typing indicator to PureCloud as the chat guest

func (ConversationGuestChat) String added in v0.1.0

func (conversation ConversationGuestChat) String() string

String gets a string version

implements the fmt.Stringer interface

type ConversationGuestChatMemberTopic added in v0.1.0

type ConversationGuestChatMemberTopic struct {
	ID            uuid.UUID
	Name          string
	Conversation  *ConversationGuestChat
	Member        *ChatMember
	Type          string // member-change
	TimeStamp     time.Time
	CorrelationID string
	Client        *Client
}

ConversationGuestChatMemberTopic describes a Topic about User's Presence

func (*ConversationGuestChatMemberTopic) GetClient added in v0.1.0

func (topic *ConversationGuestChatMemberTopic) GetClient() *Client

GetClient gets the PureCloud Client associated with this

func (ConversationGuestChatMemberTopic) Match added in v0.1.0

func (topic ConversationGuestChatMemberTopic) Match(topicName string) bool

Match tells if the given topicName matches this topic

func (*ConversationGuestChatMemberTopic) Send added in v0.1.0

Send sends the current topic to the Channel's chan

func (ConversationGuestChatMemberTopic) String added in v0.1.0

String gets a string version

implements the fmt.Stringer interface

func (ConversationGuestChatMemberTopic) TopicFor added in v0.1.0

func (topic ConversationGuestChatMemberTopic) TopicFor(identifiables ...Identifiable) string

TopicFor builds the topicName for the given identifiables

func (*ConversationGuestChatMemberTopic) UnmarshalJSON added in v0.1.0

func (topic *ConversationGuestChatMemberTopic) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

type ConversationGuestChatMessageTopic added in v0.1.0

type ConversationGuestChatMessageTopic struct {
	ID            uuid.UUID
	Name          string
	Conversation  *ConversationGuestChat
	Sender        *ChatMember
	Type          string // message, typing-indicator,
	Body          string
	BodyType      string // standard,
	TimeStamp     time.Time
	CorrelationID string
	Client        *Client
}

ConversationGuestChatMessageTopic describes a Topic about User's Presence

func (*ConversationGuestChatMessageTopic) GetClient added in v0.1.0

func (topic *ConversationGuestChatMessageTopic) GetClient() *Client

GetClient gets the PureCloud Client associated with this

func (ConversationGuestChatMessageTopic) Match added in v0.1.0

func (topic ConversationGuestChatMessageTopic) Match(topicName string) bool

Match tells if the given topicName matches this topic

func (*ConversationGuestChatMessageTopic) Send added in v0.1.0

Send sends the current topic to the Channel's chan

func (ConversationGuestChatMessageTopic) String added in v0.1.0

String gets a string version

implements the fmt.Stringer interface

func (ConversationGuestChatMessageTopic) TopicFor added in v0.1.0

func (topic ConversationGuestChatMessageTopic) TopicFor(identifiables ...Identifiable) string

TopicFor builds the topicName for the given identifiables

func (*ConversationGuestChatMessageTopic) UnmarshalJSON added in v0.1.0

func (topic *ConversationGuestChatMessageTopic) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

type ConversationMessage added in v0.1.0

type ConversationMessage struct {
	ID        uuid.UUID `json:"id"`
	Direction string    `json:"direction"` // inbound,outbound
	State     string    `json:"state"`     // alerting,dialing,contacting,offering,connected,disconnected,terminated,converting,uploading,transmitting,scheduled,none
	Held      bool      `json:"held"`

	RecordingID string `json:"recordingId"`

	Segments         []Segment `json:"segments"`
	Provider         string    `json:"provider"`
	ScriptID         string    `json:"scriptId"`
	PeerID           string    `json:"peerId"`
	Type             string    `json:"type"`
	RecipientCountry string    `json:"recipientCountry"`
	RecipientType    string    `json:"recipientType"`
	ToAddress        Address   `json:"toAddress"`
	FromAddress      Address   `json:"fromAddress"`

	ConnectedTime     time.Time `json:"connectedTime"`
	DisconnectedTime  time.Time `json:"disconnectedTime"`
	StartAlertingTime time.Time `json:"startAlertingTime"`
	StartHoldTime     time.Time `json:"startHoldTime"`

	Messages []MessageDetail `json:"messages"`

	DisconnectType string    `json:"disconnectType"` // endpoint,client,system,transfer,timeout,transfer.conference,transfer.consult,transfer.forward,transfer.noanswer,transfer.notavailable,transport.failure,error,peer,other,spam,uncallable
	ErrorInfo      ErrorBody `json:"errorInfo"`
}

ConversationMessage describes a Message (like belonging to Participant)

type ConversationRoutingData added in v0.1.0

type ConversationRoutingData struct {
	Queue        AddressableEntityRef   `json:"queue"`
	Language     AddressableEntityRef   `json:"language"`
	Priority     int                    `json:"priority"`
	Skills       []AddressableEntityRef `json:"skills"`
	ScoredAgents []struct {
		Agent AddressableEntityRef `json:"agent"`
		Score int                  `json:"score"`
	} `json:"scoredAgents"`
}

ConversationRoutingData defines routing details of a Conversation

type ConversationVideo added in v0.1.0

type ConversationVideo struct {
	ID    uuid.UUID `json:"id"`
	Self  Address   `json:"self"`
	State string    `json:"state"` // alerting,dialing,contacting,offering,connected,disconnected,terminated,converting,uploading,transmitting,scheduled,none

	Segments      []Segment `json:"segments"`
	Provider      string    `json:"provider"`
	PeerID        string    `json:"peerId"`
	PeerCount     int       `json:"peerCount"`
	Context       string    `json:"context"`
	AudioMuted    bool      `json:"audioMuted"`
	VideoMuted    bool      `json:"videoMuted"`
	SharingScreen bool      `json:"sharingScreen"`
	MSIDs         []string  `json:"msids"`

	ConnectedTime     time.Time `json:"connectedTime"`
	DisconnectedTime  time.Time `json:"disconnectedTime"`
	StartAlertingTime time.Time `json:"startAlertingTime"`

	DisconnectType string `json:"disconnectType"` // endpoint,client,system,transfer,timeout,transfer.conference,transfer.consult,transfer.forward,transfer.noanswer,transfer.notavailable,transport.failure,error,peer,other,spam,uncallable
}

ConversationVideo describes a Video (like belonging to Participant)

type DialerPreview added in v0.1.0

type DialerPreview struct {
	ID                 uuid.UUID `json:"id"`
	ContactID          uuid.UUID `json:"contactId"`
	ContactListID      uuid.UUID `json:"contactListId"`
	CampaignID         uuid.UUID `json:"campaignId"`
	PhoneNumberColumns []struct {
		Type       string `json:"type"`
		ColumnName string `json:"columnName"`
	} `json:"phoneNumberColumns"`
}

DialerPreview describes a Diapler Preview

type DisconnectReason added in v0.1.0

type DisconnectReason struct {
	Type   string `json:"type"`
	Code   string `json:"code"`
	Phrase string `json:"phrase"`
}

DisconnectReason describes the reason of a disconnect

type Disconnecter added in v0.1.0

type Disconnecter interface {
	Disconnect(identifiable Identifiable) error
}

Disconnecter describes objects that can disconnect an Identifiable from themselves

type Division added in v0.1.0

type Division struct {
	ID      uuid.UUID `json:"id"`
	Name    string    `json:"name"`
	SelfURI string    `json:"selfUri"`
}

Division describes an Authorization Division

func (Division) GetID added in v0.1.0

func (division Division) GetID() uuid.UUID

GetID gets the identifier of this

implements Identifiable

func (Division) String added in v0.1.0

func (division Division) String() string

String gets a string version

implements the fmt.Stringer interface

type DomainEntityListingEvaluationForm added in v0.1.0

type DomainEntityListingEvaluationForm struct {
	Entities    []*EvaluationForm `json:"entities"`
	Total       int               `json:"total"`
	PageSize    int               `json:"pageSize"`
	PageNumber  int               `json:"pageNumber"`
	PageCount   int               `json:"pageCount"`
	FirstUri    string            `json:"firstUri"`
	SelfUri     string            `json:"selfUri"`
	PreviousUri string            `json:"previousUri"`
	NextUri     string            `json:"nextUri"`
	LastUri     string            `json:"lastUri"`
}

DomainEntityListingEvaluationForm describes ...

type DomainEntityRef added in v0.1.0

type DomainEntityRef struct {
	ID      uuid.UUID `json:"id"`
	Name    string    `json:"name,omitempty"`
	SelfURI string    `json:"selfUri,omitempty"`
}

DomainEntityRef describes a DomainEntity Reference

func (DomainEntityRef) GetID added in v0.1.0

func (ref DomainEntityRef) GetID() uuid.UUID

GetID gets the identifier of this

implements Identifiable

func (DomainEntityRef) GetURI added in v0.1.0

func (ref DomainEntityRef) GetURI() string

GetURI gets the URI of this

implements Addressable

type DomainRole added in v0.1.0

type DomainRole struct {
	// TODO: Find out what should be here!
	ID      string `json:"id"`
	SelfURI string `json:"selfUri,omitempty"`
}

DomainRole describes a Role in a Domain

type EmployerInfo added in v0.1.0

type EmployerInfo struct {
	OfficialName string `json:"officialName"`
	EmployeeID   string `json:"employeeId"`
	EmployeeType string `json:"employeeType"`
	HiredSince   string `json:"dateHire"`
}

EmployerInfo describes Employer Information

func (EmployerInfo) String added in v0.1.0

func (info EmployerInfo) String() string

String gets a string version

implements the fmt.Stringer interface

type EntityRef added in v0.1.0

type EntityRef struct {
	ID uuid.UUID `json:"id"`
}

EntityRef describes an Entity that has an ID

func (EntityRef) GetID added in v0.1.0

func (ref EntityRef) GetID() uuid.UUID

GetID gets the identifier of this

implements Identifiable

type ErrorBody added in v0.1.0

type ErrorBody struct {
	Status            int               `json:"status"`
	Code              string            `json:"code"`
	EntityID          string            `json:"entityId"`
	EntityName        string            `json:"entityName"`
	Message           string            `json:"message"`
	MessageWithParams string            `json:"messageWithParams"`
	MessageParams     map[string]string `json:"messageParams"`
	ContextID         string            `json:"contextId"`
	Details           []ErrorDetail     `json:"details"`
	Errors            []*ErrorBody      `json:"errors"`
}

ErrorBody describes errors in PureCloud objects

func (ErrorBody) Error added in v0.1.0

func (err ErrorBody) Error() string

Error returns a string representation of this error

type ErrorDetail added in v0.1.0

type ErrorDetail struct {
	ErrorCode  string `json:"errorCode"`
	Fieldname  string `json:"fieldName"`
	EntityID   string `json:"entityId"`
	EntityName string `json:"entityName"`
}

ErrorDetail describes the details of an error

type Evaluation added in v0.1.0

type Evaluation struct {
	ID             uuid.UUID             `json:"id"`
	Name           string                `json:"name"`
	Status         string                `json:"status"`
	Queue          *Queue                `json:"queue"`
	Conversation   *Conversation         `json:"conversation"`
	EvaluationForm *EvaluationForm       `json:"evaluationForm"`
	Evaluator      *User                 `json:"evaluator"`
	Agent          *User                 `json:"agent"`
	Calibration    *Calibration          `json:"calibration"`
	Answers        *EvaluationScoringSet `json:"answers"`
	AgentHasRead   bool                  `json:"agentHasRead"`
	ReleaseDate    time.Time             `json:"releaseDate"`
	AssignedDate   time.Time             `json:"assignedDate"`
	ChangedDate    time.Time             `json:"changedDate"`
}

Evaluation describes an Evaluation (like belonging to Participant)

func (Evaluation) GetID added in v0.1.0

func (evaluation Evaluation) GetID() uuid.UUID

GetID gets the identifier of this

implements Identifiable

func (Evaluation) String added in v0.1.0

func (evaluation Evaluation) String() string

String gets a string version

implements the fmt.Stringer interface

type EvaluationForm added in v0.1.0

type EvaluationForm struct {
	ID      uuid.UUID `json:"id"`
	Name    string    `json:"name"`
	SelfURI string    `json:"selfUri"`

	ModifiedDate time.Time `json:"modifiedDate"`
	Published    bool      `json:"published"`
	ContextID    string    `json:"contextId"`

	QuestionGroups    []EvaluationQuestionGroup         `json:"questionGroups"`
	PublishedVersions DomainEntityListingEvaluationForm `json:"publishedVersions"`
}

EvaluationForm describes an Evaluation Form

type EvaluationQuestion added in v0.1.0

type EvaluationQuestion struct {
	ID                  uuid.UUID            `json:"id"`
	Type                string               `json:"type"`
	Text                string               `json:"text"`
	HelpText            string               `json:"helpText"`
	NAEnabled           bool                 `json:"naEnabled"`
	CommentsRequired    bool                 `json:"commentsRequired"`
	IsKill              bool                 `json:"isKill"`
	IsCritical          bool                 `json:"isCritical"`
	VisibilityCondition *VisibilityCondition `json:"visibilityCondition"`
	AnswerOptions       []*AnswerOption      `json:"answerOptions"`
}

EvaluationQuestion describe an Evaluation Question

type EvaluationQuestionGroup added in v0.1.0

type EvaluationQuestionGroup struct {
	ID                      uuid.UUID             `json:"id"`
	Name                    string                `json:"name"`
	Type                    string                `json:"type"`
	DefaultAnswersToHighest bool                  `json:"defaultAnswersToHighest"`
	DefaultAnswersToNA      bool                  `json:"defaultAnswersToNA"`
	NAEnabled               bool                  `json:"naEnabled"`
	Weight                  float64               `json:"weight"`
	ManualWeight            bool                  `json:"manualWeight"`
	Questions               []*EvaluationQuestion `json:"questions"`
	VisibilityCondition     *VisibilityCondition  `json:"visibilityCondition"`
}

EvaluationQuestionGroup describes a Group of Evaluation Questions

type EvaluationScoringSet added in v0.1.0

type EvaluationScoringSet struct {
	TotalScore         float64 `json:"totalScore"`
	TotalCriticalScore float64 `json:"totalCriticalScore"`
}

EvaluationScoringSet describes an Evaluation Scoring Set

type FaxStatus added in v0.1.0

type FaxStatus struct {
	Direction        string `json:"direction"` // inbound,outbound
	ActivePage       int    `json:"activePage"`
	ExpectedPages    int    `json:"expectedPages"`
	LinesTransmitted int    `json:"linesTransmitted"`
	BytesTransmitted int    `json:"bytesTransmitted"`
	BaudRate         int    `json:"baudRate"`
	PageErrors       int    `json:"pageErrors"`
	LineErrors       int    `json:"lineErrors"`
}

FaxStatus describes a FAX status

type GeoLocation added in v0.1.0

type GeoLocation struct {
	ID        string                `json:"id"`
	SelfURI   string                `json:"selfUri"`
	Name      string                `json:"name"`
	Locations []*LocationDefinition `json:"locations"`
}

GeoLocation describes a location with coordinates

type Group added in v0.1.0

type Group struct {
	ID           uuid.UUID      `json:"id"`
	SelfURI      string         `json:"selfUri"`
	Name         string         `json:"name"`
	Type         string         `json:"type"`
	Description  string         `json:"description"`
	State        string         `json:"state"`
	MemberCount  int            `json:"memberCount"`
	Owners       []*User        `json:"owners"`
	Images       []*UserImage   `json:"images"`
	Addresses    []*Contact     `json:"addresses"`
	RulesVisible bool           `json:"rulesVisible"`
	Visibility   bool           `json:"visibility"`
	DateModified time.Time      `json:"dateModified"`
	Version      int            `json:"version"`
	Client       *Client        `json:"-"`
	Logger       *logger.Logger `json:"-"`
}

Group describe a Group of users

func (Group) GetID added in v0.1.0

func (group Group) GetID() uuid.UUID

GetID gets the identifier of this

implements Identifiable

func (*Group) Initialize added in v0.1.0

func (group *Group) Initialize(parameters ...interface{}) error

Initialize initializes this from the given Client

implements Initializable
if the group ID is given in group, the group is fetched

func (Group) String added in v0.1.0

func (group Group) String() string

String gets a string version

implements the fmt.Stringer interface

type Identifiable added in v0.1.0

type Identifiable interface {
	core.Identifiable
}

Identifiable describes that can get their Identifier as a UUID

type Initializable added in v0.1.0

type Initializable interface {
	Initialize(parameters ...interface{}) error
}

Initializable describes things that can be initialized

type Jabber added in v0.2.0

type Jabber struct {
	ID string `json:"jabberId"`
}

Jabber describe a Jabber ID for chats

type JourneyContext added in v0.1.0

type JourneyContext struct {
	Customer struct {
		ID     uuid.UUID `json:"id"`
		IDType string    `json:"idType"`
	} `json:"customer"`
	CustomerSession struct {
		ID   uuid.UUID `json:"id"`
		Type string    `json:"type"`
	} `json:"customerSession"`
	TriggeringAction struct {
		ID        uuid.UUID `json:"id"`
		ActionMap struct {
			ID      uuid.UUID `json:"id"`
			Version int       `json:"version"`
		} `json:"actionMap"`
	} `json:"triggeringAction"`
}

JourneyContext describes a Journey Context

type Location added in v0.1.0

type Location struct {
	ID                 string              `json:"id"`
	FloorplanID        string              `json:"floorplanId"`
	Coordinates        map[string]float64  `json:"coordinates"`
	Notes              string              `json:"notes"`
	LocationDefinition *LocationDefinition `json:"locationDefinition"`
}

Location describes a location in a building

type LocationAddress added in v0.1.0

type LocationAddress struct {
	Country     string `json:"country"`
	CountryName string `json:"countryName"`
	State       string `json:"State"`
	City        string `json:"City"`
	ZipCode     string `json:"zipcode"`
	Street1     string `json:"street1"`
	Street2     string `json:"street2"`
}

LocationAddress describes the address of a Location

type LocationDefinition added in v0.1.0

type LocationDefinition struct {
	ID              string                   `json:"id"`
	SelfURI         string                   `json:"selfUri"`
	Name            string                   `json:"name"`
	ContactUser     *AddressableEntityRef    `json:"contactUser"`
	EmergencyNumber *LocationEmergencyNumber `json:"emergencyNumber"`
	Address         *LocationAddress         `json:"address"`
	AddressVerified bool                     `json:"addressVerified"`
	State           string                   `json:"state"`
	Notes           string                   `json:"notes"`
	Path            []string                 `json:"path"`
	ProfileImage    []*LocationImage         `json:"profileImage"`
	FloorplanImage  []*LocationImage         `json:"flooreImage"`
	Version         int                      `json:"version"`
}

LocationDefinition describes a location (office, etc)

func (LocationDefinition) GetID added in v0.1.0

func (location LocationDefinition) GetID() string

GetID gets the identifier of this

implements Identifiable

func (LocationDefinition) String added in v0.1.0

func (location LocationDefinition) String() string

String gets a string version

implements the fmt.Stringer interface

type LocationEmergencyNumber added in v0.1.0

type LocationEmergencyNumber struct {
	Type   string `json:"type"` // default, elin
	Number string `json:"number"`
	E164   string `json:"e164"`
}

LocationEmergencyNumber describes a Location's Emergency Number

type LocationImage added in v0.1.0

type LocationImage struct {
	ImageURL   *url.URL `json:"-"`
	Resolution string   `json:"resolution"`
}

LocationImage describes the image of a Location

func (LocationImage) MarshalJSON added in v0.1.0

func (locationImage LocationImage) MarshalJSON() ([]byte, error)

MarshalJSON marshals this into JSON

func (*LocationImage) UnmarshalJSON added in v0.1.0

func (locationImage *LocationImage) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

type MediaParticipantRequest added in v0.1.0

type MediaParticipantRequest struct {
	Wrapup        *Wrapup `json:"wrapup,omitempty"`
	State         string  `json:"state,omitempty"` // alerting, dialing, contacting, offering, connected, disconnected, terminated, converting, uploading, transmitting, none
	Recording     bool    `json:"recording,omitempty"`
	Muted         bool    `json:"muted,omitempty"`
	Confined      bool    `json:"confined,omitempty"`
	Held          bool    `json:"held,omitempty"`
	WrapupSkipped bool    `json:"wrapupSkipped,omitempty"`
}

MediaParticipantRequest describes a request Media Participant

type MediaSetting added in v0.1.0

type MediaSetting struct {
	AlertingTimeout time.Duration
	ServiceLevel    ServiceLevel
}

MediaSetting defines a media setting in a Queue

func (MediaSetting) MarshalJSON added in v0.1.0

func (setting MediaSetting) MarshalJSON() ([]byte, error)

MarshalJSON marshals this into JSON

func (*MediaSetting) UnmarshalJSON added in v0.1.0

func (setting *MediaSetting) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

type MediaSettings added in v0.1.0

type MediaSettings map[string]MediaSetting

MediaSettings is a map of media names and settings

type MediaSummary added in v0.1.0

type MediaSummary struct {
	ContactCenter MediaSummaryDetail `json:"contactCenter"`
	Enterprise    MediaSummaryDetail `json:"enterprise"`
}

MediaSummary describes a Media summary

type MediaSummaryDetail added in v0.1.0

type MediaSummaryDetail struct {
	Active int `json:"active"`
	ACW    int `json:"acw"`
}

MediaSummaryDetail describes the details about a MediaSummary

type MessageDetail added in v0.1.0

type MessageDetail struct {
	ID           string           `json:"messageId"`
	MessageURI   string           `json:"messageURI"`
	Status       string           `json:"messageStatus"`
	SegmentCount string           `json:"messageSegmentCount"`
	Time         time.Time        `json:"messageTime"`
	Media        MessageMedia     `json:"media"`
	Stickers     []MessageSticker `json:"stickers"`
}

MessageDetail describes details about a Message

type MessageMedia added in v0.1.0

type MessageMedia struct {
	ID            string `json:"id"`
	Name          string `json:"name"`
	URL           string `json:"url"`
	MediaType     string `json:"mediaType"`
	ContentLength string `json:"contentLengthBytes"`
}

MessageMedia describes the Media of a Message

type MessageSticker added in v0.1.0

type MessageSticker struct {
	ID  string `json:"id"`
	URL string `json:"url"`
}

MessageSticker describes a Message Sticker

type MessagingTemplate added in v0.2.0

type MessagingTemplate struct {
	ResponseID string              `json:"responseId"`
	Parameters []TemplateParameter `json:"parameters"`
}

MessagingTemplate describes the Template to use (WhatsApp Template, for example)

type MetadataTopic added in v0.1.0

type MetadataTopic struct {
	Name    string
	Message string
	Client  *Client
}

MetadataTopic describes a Topic about the channel itself

func (*MetadataTopic) GetClient added in v0.1.0

func (topic *MetadataTopic) GetClient() *Client

GetClient gets the PureCloud Client associated with this

func (MetadataTopic) Match added in v0.1.0

func (topic MetadataTopic) Match(topicName string) bool

Match tells if the given topicName matches this topic

func (*MetadataTopic) Send added in v0.1.0

func (topic *MetadataTopic) Send(channel *NotificationChannel)

Send sends the current topic to the Channel's chan

func (MetadataTopic) TopicFor added in v0.1.0

func (topic MetadataTopic) TopicFor(identifiables ...Identifiable) string

TopicFor builds the topicName for the given identifiables

func (*MetadataTopic) UnmarshalJSON added in v0.1.0

func (topic *MetadataTopic) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

type NotificationChannel added in v0.1.0

type NotificationChannel struct {
	ID            uuid.UUID              `json:"id"`
	ConnectURL    *url.URL               `json:"-"`
	ExpiresOn     time.Time              `json:"expires"`
	LogHeartbeat  bool                   `json:"logHeartbeat"`
	Logger        *logger.Logger         `json:"-"`
	Client        *Client                `json:"-"`
	Socket        *websocket.Conn        `json:"-"`
	TopicReceived chan NotificationTopic `json:"-"`
}

NotificationChannel defines a Notification Channel

See: https://developer.mypurecloud.com/api/rest/v2/notifications/notification_service.html

func (*NotificationChannel) Close added in v0.1.0

func (channel *NotificationChannel) Close() (err error)

Close unsubscribes from all subscriptions and closes the websocket

func (NotificationChannel) GetID added in v0.1.0

func (channel NotificationChannel) GetID() uuid.UUID

GetID gets the identifier of this

implements Identifiable

func (*NotificationChannel) GetTopics added in v0.1.0

func (channel *NotificationChannel) GetTopics() ([]string, error)

GetTopics gets all subscription topics set on this

func (*NotificationChannel) IsSubscribed added in v0.1.0

func (channel *NotificationChannel) IsSubscribed(topic string) bool

IsSubscribed tells if the channel is subscribed to the given topic

func (NotificationChannel) MarshalJSON added in v0.1.0

func (channel NotificationChannel) MarshalJSON() ([]byte, error)

MarshalJSON marshals this into JSON

func (*NotificationChannel) SetTopics added in v0.1.0

func (channel *NotificationChannel) SetTopics(topics ...string) ([]string, error)

SetTopics sets the subscriptions. It overrides any previous subscriptions

func (NotificationChannel) String added in v0.1.0

func (channel NotificationChannel) String() string

String gets a string version

implements the fmt.Stringer interface

func (*NotificationChannel) Subscribe added in v0.1.0

func (channel *NotificationChannel) Subscribe(topics ...string) ([]string, error)

Subscribe subscribes to a list of topics in the NotificationChannel

func (*NotificationChannel) UnmarshalJSON added in v0.1.0

func (channel *NotificationChannel) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

func (*NotificationChannel) Unsubscribe added in v0.1.0

func (channel *NotificationChannel) Unsubscribe(topics ...string) error

Unsubscribe unsubscribes from some topics,

If there is no argument, unsubscribe from all topics

type NotificationTopic added in v0.1.0

type NotificationTopic interface {
	// Match tells if the given topicName matches this topic
	Match(topicName string) bool

	// Get the PureCloud Client associated with this
	GetClient() *Client

	// Send sends the current topic to the Channel's chan
	Send(channel *NotificationChannel)

	// TopicFor builds the topicName for the given identifiables
	TopicFor(identifiables ...Identifiable) string
}

NotificationTopic describes a Notification Topic received on a WebSocket

func NotificationTopicFromJSON added in v0.1.0

func NotificationTopicFromJSON(payload []byte) (NotificationTopic, error)

NotificationTopicFromJSON Unmarshal JSON into a NotificationTopic

type NotificationTopicDefinition added in v0.1.0

type NotificationTopicDefinition struct {
	ID          string                 `json:"id"`
	Description string                 `json:"description"`
	Permissions []string               `json:"requiresPermissions"`
	Schema      map[string]interface{} `json:"schema"`
}

NotificationTopicDefinition defines a Notification Topic that can subscribed to

type OpenMessage added in v0.2.0

type OpenMessage struct {
	ID              string                `json:"id,omitempty"`
	Channel         *OpenMessageChannel   `json:"channel"`
	Direction       string                `json:"direction"`
	Type            string                `json:"type"` // Text, Structured, Receipt
	Text            string                `json:"text"`
	Content         []*OpenMessageContent `json:"content,omitempty"`
	RelatedMessages []*OpenMessage        `json:"relatedMessages,omitempty"`
	Reasons         []*StatusReason       `json:"reasons,omitempty"`
}

type OpenMessageAttachment added in v0.2.1

type OpenMessageAttachment struct {
	ID       string   `json:"id"`
	Type     string   `json:"mediaType"`
	URL      *url.URL `json:"-"`
	Mime     string   `json:"mime,omitempty"`
	Filename string   `json:"filename,omitempty"`
	Text     string   `json:"text,omitempty"`
	Hash     string   `json:"sha256,omitempty"`
}

func (OpenMessageAttachment) MarshalJSON added in v0.2.1

func (attachment OpenMessageAttachment) MarshalJSON() ([]byte, error)

MarshalJSON marshals this into JSON

func (*OpenMessageAttachment) UnmarshalJSON added in v0.2.1

func (attachment *OpenMessageAttachment) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

type OpenMessageChannel added in v0.2.0

type OpenMessageChannel struct {
	Platform  string           `json:"platform"` // Open
	Type      string           `json:"type"`     // Private, Public
	MessageID string           `json:"messageId"`
	Time      time.Time        `json:"-"`
	To        *OpenMessageTo   `json:"to"`
	From      *OpenMessageFrom `json:"from"`
}

func NewOpenMessageChannel added in v0.2.1

func NewOpenMessageChannel(messageID string, to *OpenMessageTo, from *OpenMessageFrom) *OpenMessageChannel

func (OpenMessageChannel) MarshalJSON added in v0.2.1

func (channel OpenMessageChannel) MarshalJSON() ([]byte, error)

MarshalJSON marshals this into JSON

func (*OpenMessageChannel) UnmarshalJSON added in v0.2.1

func (channel *OpenMessageChannel) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

type OpenMessageContent added in v0.2.0

type OpenMessageContent struct {
	Type       string                 `json:"contentType"` // Attachment, Location, QuickReply, ButtonResponse, Notification, GenericTemplate, ListTemplate, Postback, Reactions, Mention
	Attachment *OpenMessageAttachment `json:"attachment"`
}

func (*OpenMessageContent) UnmarshalJSON added in v0.2.1

func (content *OpenMessageContent) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

type OpenMessageFrom added in v0.2.0

type OpenMessageFrom struct {
	ID        string `json:"id"`
	Type      string `json:"idType"`
	Firstname string `json:"firstName"`
	Lastname  string `json:"lastName"`
	Nickname  string `json:"nickname"`
}

type OpenMessageResult added in v0.2.0

type OpenMessageResult struct {
	OpenMessage
}

type OpenMessageTo added in v0.2.0

type OpenMessageTo struct {
	ID string `json:"id"`
}

type OpenMessagingIntegration added in v0.2.0

type OpenMessagingIntegration struct {
	ID               uuid.UUID             `json:"id"`
	Name             string                `json:"name"`
	WebhookURL       *url.URL              `json:"-"`
	WebhookToken     string                `json:"outboundNotificationWebhookSignatureSecretToken"`
	Recipient        *DomainEntityRef      `json:"recipient,omitempty"`
	SupportedContent *AddressableEntityRef `json:"supportedContent,omitempty"`
	DateCreated      time.Time             `json:"dateCreated,omitempty"`
	CreatedBy        *DomainEntityRef      `json:"createdBy,omitempty"`
	DateModified     time.Time             `json:"dateModified,omitempty"`
	ModifiedBy       *DomainEntityRef      `json:"modifiedBy,omitempty"`
	CreateStatus     string                `json:"createStatus,omitempty"`
	CreateError      *ErrorBody            `json:"createError,omitempty"`
	SelfURI          URI                   `json:"selfUri,omitempty"`
	Client           *Client               `json:"-"`
	Logger           *logger.Logger        `json:"-"`
}

OpenMessagingIntegration describes an GCloud OpenMessaging Integration

See https://developer.genesys.cloud/api/digital/openmessaging

func FetchOpenMessagingIntegration added in v0.2.0

func FetchOpenMessagingIntegration(parameters ...interface{}) (*OpenMessagingIntegration, error)

FetchOpenMessagingIntegration Fetches an OpenMessagingIntegration object

If a UUID is given, fetches by UUID

If a string is given, fetches by name

func FetchOpenMessagingIntegrations added in v0.2.0

func FetchOpenMessagingIntegrations(parameters ...interface{}) ([]*OpenMessagingIntegration, error)

FetchOpenMessagingIntegrations Fetches all OpenMessagingIntegration object

func (*OpenMessagingIntegration) Create added in v0.2.0

func (integration *OpenMessagingIntegration) Create(name string, webhookURL *url.URL, token string) error

Create creates a new OpenMessaging Integration

func (*OpenMessagingIntegration) Delete added in v0.2.0

func (integration *OpenMessagingIntegration) Delete() error

Delete deletes an OpenMessaging Integration

If the integration was not created, nothing is done

func (OpenMessagingIntegration) GetID added in v0.2.0

func (integration OpenMessagingIntegration) GetID() uuid.UUID

GetID gets the identifier of this

implements Identifiable

func (*OpenMessagingIntegration) Initialize added in v0.2.0

func (integration *OpenMessagingIntegration) Initialize(parameters ...interface{}) error

Initialize initializes this from the given Client

if the parameters contain a uuid.UUID, the corresponding integration is fetched

implements Initializable

func (OpenMessagingIntegration) MarshalJSON added in v0.2.0

func (integration OpenMessagingIntegration) MarshalJSON() ([]byte, error)

MarshalJSON marshals this into JSON

func (*OpenMessagingIntegration) SendInboundImageMessage added in v0.2.1

func (integration *OpenMessagingIntegration) SendInboundImageMessage(from *OpenMessageFrom, messageID, text string, imageMimeType string, imageURL *url.URL) (*OpenMessageResult, error)

SendInboundImageMessage sends a text message from the middleware to GENESYS Cloud

See https://developer.genesys.cloud/api/digital/openmessaging/inboundMessages#inbound-message-with-attached-photo

func (*OpenMessagingIntegration) SendInboundTextMessage added in v0.2.1

func (integration *OpenMessagingIntegration) SendInboundTextMessage(from *OpenMessageFrom, messageID, text string) (*OpenMessageResult, error)

SendInboundTextMessage sends a text message from the middleware to GENESYS Cloud

See https://developer.genesys.cloud/api/digital/openmessaging/inboundMessages#send-an-inbound-open-message

func (*OpenMessagingIntegration) SendOutboundMessage added in v0.2.0

func (integration *OpenMessagingIntegration) SendOutboundMessage(destination, text string) (*AgentlessMessageResult, error)

SendOutboundMessage sends a message from GENESYS Cloud to the middleware

The message can be only text as it is sent bia the AgentLess Message API.

This is mainly for debugging purposes

See https://developer.genesys.cloud/api/digital/openmessaging/outboundMessages#send-an-agentless-outbound-text-message

func (OpenMessagingIntegration) String added in v0.2.0

func (integration OpenMessagingIntegration) String() string

String gets a string version

implements the fmt.Stringer interface

func (*OpenMessagingIntegration) UnmarshalJSON added in v0.2.0

func (integration *OpenMessagingIntegration) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

func (*OpenMessagingIntegration) Update added in v0.2.0

func (integration *OpenMessagingIntegration) Update(name string, webhookURL *url.URL, token string) error

Update updates an OpenMessaging Integration

If the integration was not created, an error is return without reaching GENESYS Cloud

type Organization

type Organization struct {
	ID                         uuid.UUID       `json:"id"`
	Name                       string          `json:"name"`
	DefaultLanguage            string          `json:"defaultLanguage"`
	ThirdPartyOrganizationName string          `json:"thirdPartyOrgName"`
	ThirdPartyURI              string          `json:"thirdPartyURI"`
	Domain                     string          `json:"domain"`
	State                      string          `json:"state"`
	DefaultSiteID              string          `json:"defaultSiteId"`
	SupportURI                 string          `json:"supportURI"`
	VoicemailEnabled           bool            `json:"voicemailEnabled"`
	SelfURI                    string          `json:"selfURI"`
	Features                   map[string]bool `json:"features"`
	Version                    uint32          `json:"version"`
	Client                     *Client         `json:"-"`
	Logger                     *logger.Logger  `json:"-"`
}

Organization describes a PureCloud Organization

func (Organization) GetID added in v0.1.0

func (organization Organization) GetID() uuid.UUID

GetID gets the identifier of this

implements Identifiable

func (*Organization) Initialize added in v0.1.0

func (organization *Organization) Initialize(parameters ...interface{}) error

Initialize initializes this from the given Client

implements Initializable
If the organzation ID is not given, /organizations/me is fetched

func (Organization) String added in v0.1.0

func (organization Organization) String() string

String gets a string version

implements the fmt.Stringer interface

type OutOfOffice added in v0.1.0

type OutOfOffice struct {
	ID           string    `json:"id"`
	Name         string    `json:"name"`
	SelfURI      string    `json:"selfUri"`
	User         *User     `json:"user"`
	Active       bool      `json:"active"`
	Indefinite   bool      `json:"indefinite"`
	StartDate    time.Time `json:"startDate"`
	EndDate      time.Time `json:"endDate"`
	ModifiedDate time.Time `json:"modifiedDate"`
}

OutOfOffice describes the Out Of Office status

type Participant added in v0.1.0

type Participant struct {
	ID              uuid.UUID `json:"id"`
	SelfURI         string    `json:"selfUri"`
	Name            string    `json:"name"`
	ParticipantType string    `json:"participantType"`
	State           string    `json:"state"`
	Held            bool      `json:"held"`
	Direction       string    `json:"direction"`
	StartTime       time.Time `json:"startTime"`
	ConnectedTime   time.Time `json:"connectedTime"`
	EndTime         time.Time `json:"endTime"`
	StartHoldTime   time.Time `json:"startHoldTime"`
	Purpose         string    `json:"purpose"`
	DisconnectType  string    `json:"disconnectType"`

	User                   *User            `json:"user"`
	ExternalContact        *DomainEntityRef `json:"externalContact"`
	ExternalContactID      string           `json:"externalContactId"`
	ExternalOrganization   *DomainEntityRef `json:"externalOrganization"`
	ExternalOrganizationID string           `json:"externalOrganizationId"`

	Queue                  *Queue           `json:"queue"`
	QueueID                string           `json:"queueId"`
	GroupID                string           `json:"groupId"`
	QueueName              string           `json:"queueName"`
	ConsultParticipantID   string           `json:"consultParticipantId"`
	MonitoredParticipantID string           `json:"monitoredParticipantId"`
	Script                 *DomainEntityRef `json:"script"`

	Address string `json:"address"`
	ANI     string `json:"ani"`
	ANIName string `json:"aniName"`
	DNIS    string `json:"dnis"`
	Locale  string `json:"locale"`

	Attributes        map[string]string       `json:"attributes"`
	Calls             []*ConversationCall     `json:"calls"`
	Callbacks         []*ConversationCallback `json:"callbacks"`
	Chats             []*ConversationChat     `json:"chats"`
	CobrowseSessions  []*CobrowseSession      `json:"cobrowseSession"`
	Emails            []*ConversationEmail    `json:"emails"`
	Messages          []*ConversationMessage  `json:"messages"`
	ScreenShares      []*ScreenShare          `json:"screenShares"`
	SocialExpressions []*SocialExpression     `json:"socialExpressions"`
	Videos            []*ConversationVideo    `json:"videos"`
	Evaluations       []*Evaluation           `json:"evaluations"`

	WrapupRequired bool          `json:"wrapupRequired"`
	WrapupPrompt   string        `json:"wrapupPrompt"`
	WrapupTimeout  time.Duration `json:"-"`
	WrapupSkipped  bool          `json:"wrapupSkipped"`
	Wrapup         *Wrapup       `json:"wrapup"`

	AlertingTimeout      time.Duration           `json:"-"`
	ScreenRecordingState string                  `json:"screenRecordingState"`
	FlaggedReason        string                  `json:"flaggedReason"`
	Peer                 string                  `json:"peer"`
	RoutingData          ConversationRoutingData `json:"conversationRoutingData"`
	JourneyContext       *JourneyContext         `json:"journeyContext"`
	ErrorInfo            *ErrorBody              `json:"errorInfo"`
}

Participant describes a Chat Participant

func (Participant) GetID added in v0.1.0

func (participant Participant) GetID() uuid.UUID

GetID gets the identifier of this

implements Identifiable

func (Participant) IsMember added in v0.1.0

func (participant Participant) IsMember(mediaType string, identifiable Identifiable) bool

IsMember tells if the Participant is a memmber of the Conversation (Identifiable)

func (Participant) MarshalJSON added in v0.1.0

func (participant Participant) MarshalJSON() ([]byte, error)

MarshalJSON marshals this into JSON

func (Participant) String added in v0.1.0

func (participant Participant) String() string

String gets a string version

implements the fmt.Stringer interface

func (*Participant) UnmarshalJSON added in v0.1.0

func (participant *Participant) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

func (*Participant) UpdateState added in v0.1.0

func (participant *Participant) UpdateState(target StateUpdater, state string) error

UpdateState updates the state of the Participant in target

type PresenceDefinition added in v0.1.0

type PresenceDefinition struct {
	ID             string `json:"id"`
	SystemPresence string `json:"systemPresence"`
	SelfURI        string `json:"selfUri"`
}

PresenceDefinition defines Presence

func (PresenceDefinition) GetID added in v0.1.0

func (definition PresenceDefinition) GetID() string

GetID gets the identifier of this

implements Identifiable

func (PresenceDefinition) String added in v0.1.0

func (definition PresenceDefinition) String() string

String gets a string version

implements the fmt.Stringer interface

type Queue added in v0.1.0

type Queue struct {
	ID                    uuid.UUID      `json:"id"`
	Name                  string         `json:"name"`
	CreatedBy             *User          `json:"-"`
	ModifiedBy            string         `json:"modifiedBy"`
	DateCreated           time.Time      `json:"dateCreated"`
	Division              *Division      `json:"division"`
	MemberCount           int            `json:"memberCount"`
	MediaSettings         MediaSettings  `json:"mediaSettings"`
	ACWSettings           ACWSettings    `json:"acwSettings"`
	SkillEvaluationMethod string         `json:"skillEvaluationMethod"`
	AutoAnswerOnly        bool           `json:"true"`
	DefaultScripts        interface{}    `json:"defaultScripts"`
	SelfURI               string         `json:"selfUri"`
	Client                *Client        `json:"-"`
	Logger                *logger.Logger `json:"-"`
}

Queue defines a PureCloud Queue

func (Queue) GetID added in v0.1.0

func (queue Queue) GetID() uuid.UUID

GetID gets the identifier of this

implements Identifiable

func (Queue) String added in v0.1.0

func (queue Queue) String() string

func (*Queue) UnmarshalJSON added in v0.1.0

func (queue *Queue) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

type ResourcePermissionPolicy added in v0.1.0

type ResourcePermissionPolicy struct {
	// TODO: Find out what should be here!
	ID      string `json:"id"`
	SelfURI string `json:"selfUri,omitempty"`
}

ResourcePermissionPolicy describes...

type RoutingStatus added in v0.1.0

type RoutingStatus struct {
	UserID    string    `json:"userId"`
	Status    string    `json:"status"` // OFF_QUEUE, IDLE, INTERACTING, NOT_RESPONDING, COMMUNICATING
	StartTime time.Time `json:"startTime"`
}

RoutingStatus describes a Routing Status

type RoutingTarget added in v0.1.0

type RoutingTarget struct {
	Type    string `json:"targetType,omitempty"`
	Address string `json:"targetAddress,omitempty"`
}

RoutingTarget describes a routing target

type ScreenShare added in v0.1.0

type ScreenShare struct {
	ID                uuid.UUID `json:"id"`
	State             string    `json:"state"` // alerting,dialing,contacting,offering,connected,disconnected,terminated,converting,uploading,transmitting,scheduled,none
	Sharing           bool      `json:"sharing"`
	Segments          []Segment `json:"segments"`
	PeerCount         int       `json:"peerCount"`
	Provider          string    `json:"provider"`
	PeerID            uuid.UUID `json:"peerId"`
	ConnectedTime     time.Time `json:"connectedTime"`
	DisconnectedTime  time.Time `json:"disconnectedTime"`
	StartAlertingTime time.Time `json:"startAlertingTime"`
	DisconnectType    string    `json:"disconnectType"` // endpoint,client,system,transfer,timeout,transfer.conference,transfer.consult,transfer.forward,transfer.noanswer,transfer.notavailable,transport.failure,error,peer,other,spam,uncallable
}

ScreenShare describes a Screen Share (like belonging to Participant)

func (ScreenShare) GetID added in v0.1.0

func (screenShare ScreenShare) GetID() uuid.UUID

GetID gets the identifier of this

implements Identifiable

func (ScreenShare) String added in v0.1.0

func (screenShare ScreenShare) String() string

String gets a string version

implements the fmt.Stringer interface

type Segment added in v0.1.0

type Segment struct {
	Type           string    `json:"type"`
	DisconnectType string    `json:"disconnectType"`
	StartTime      time.Time `json:"startTime"`
	EndTime        time.Time `json:"endTime"`
	HowEnded       string    `json:"howEnded"`
}

Segment describes a fragment of a Conversation

type ServiceLevel added in v0.1.0

type ServiceLevel struct {
	Percentage float64
	Duration   time.Duration
}

ServiceLevel defines a Service Level

func (ServiceLevel) MarshalJSON added in v0.1.0

func (serviceLevel ServiceLevel) MarshalJSON() ([]byte, error)

MarshalJSON marshals this into JSON

func (*ServiceLevel) UnmarshalJSON added in v0.1.0

func (serviceLevel *ServiceLevel) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

type SocialExpression added in v0.1.0

type SocialExpression struct {
	ID                uuid.UUID `json:"id"`
	Direction         string    `json:"direction"` // inbound,outbound
	State             string    `json:"state"`     // alerting,dialing,contacting,offering,connected,disconnected,terminated,converting,uploading,transmitting,scheduled,none
	Held              bool      `json:"held"`
	RecordingID       string    `json:"recordingId"`
	Segments          []Segment `json:"segments"`
	Provider          string    `json:"provider"`
	ScriptID          string    `json:"scriptId"`
	PeerID            string    `json:"peerId"`
	SocialMediaID     string    `json:"socialMediaId"`
	SocialMediaHub    string    `json:"socialMediaHub"`
	SocialMediaName   string    `json:"socialMediaName"`
	PreviewText       string    `json:"previewText"`
	ConnectedTime     time.Time `json:"connectedTime"`
	DisconnectedTime  time.Time `json:"disconnectedTime"`
	StartAlertingTime time.Time `json:"startAlertingTime"`
	StartHoldTime     time.Time `json:"startHoldTime"`
	DisconnectType    string    `json:"disconnectType"` // endpoint,client,system,transfer,timeout,transfer.conference,transfer.consult,transfer.forward,transfer.noanswer,transfer.notavailable,transport.failure,error,peer,other,spam,uncallable
}

SocialExpression describes a SocialExpression (like belonging to Participant)

func (SocialExpression) GetID added in v0.1.0

func (socialExpression SocialExpression) GetID() uuid.UUID

GetID gets the identifier of this

implements Identifiable

func (SocialExpression) String added in v0.1.0

func (socialExpression SocialExpression) String() string

String gets a string version

implements the fmt.Stringer interface

type StateUpdater added in v0.1.0

type StateUpdater interface {
	UpdateState(identifiable Identifiable, state string) error
}

StateUpdater describes objects than can update the state of an Identifiable

type StatusReason added in v0.2.0

type StatusReason struct {
	Code    string `json:"code,omitempty"`
	Message string `json:"message"`
}

type TemplateParameter added in v0.2.0

type TemplateParameter struct {
	ID    string `json:"id"`
	Value string `json:"value"`
}

TemplateParameter describes a template parameter

type Transferrer added in v0.1.5

type Transferrer interface {
	Transfer(identifiable Identifiable, target Identifiable) error
}

Transferrer describes objects that can transfer an Identifiable somewhere else

type URI added in v0.2.0

type URI string

URI represents the Path of a URL (used in SelfURI, for example)

func NewURI added in v0.2.0

func NewURI(path string, args ...interface{}) URI

NewURI creates a new URI with eventually some parameters

path should be a formatter string

func (URI) HasPrefix added in v0.2.0

func (uri URI) HasPrefix(prefix string) bool

func (URI) HasProtocol added in v0.2.0

func (uri URI) HasProtocol() bool

func (URI) Join added in v0.2.0

func (uri URI) Join(uris ...URI) URI

func (URI) String added in v0.2.0

func (uri URI) String() string

func (URI) URL added in v0.2.0

func (uri URI) URL() (*url.URL, error)

type UpdatedAccessToken added in v0.3.0

type UpdatedAccessToken struct {
	AccessToken
	CustomData interface{}
}

UpdatedAccessToken describes an updated Access Token

This object is sent by the AuthorizationGrant.Authorize() when the token is updated

type User added in v0.1.0

type User struct {
	ID                  uuid.UUID                `json:"id"`
	SelfURI             string                   `json:"selfUri"`
	Name                string                   `json:"name"`
	UserName            string                   `json:"username"`
	Department          string                   `json:"department,omitempty"`
	Title               string                   `json:"title"`
	Division            *Division                `json:"division"`
	Mail                string                   `json:"email"`
	Images              []*UserImage             `json:"images"`
	PrimaryContact      []*Contact               `json:"primaryContactInfo"`
	Addresses           []*Contact               `json:"addresses"`
	State               string                   `json:"state"`
	Presence            *UserPresence            `json:"presence,omitempty"`
	OutOfOffice         *OutOfOffice             `json:"outOfOffice,omitempty"`
	AcdAutoAnswer       bool                     `json:"acdAutoAnswer"`
	RoutingStatus       *RoutingStatus           `json:"routingStatus,omitempty"`
	ProfileSkills       []string                 `json:"profileSkills,omitempty"`
	Skills              []*UserRoutingSkill      `json:"skills,omitempty"`
	Languages           []*UserRoutingLanguage   `json:"languages,omitempty"`
	LanguagePreference  string                   `json:"languagePreference,omitempty"`
	Groups              []*Group                 `json:"groups,omitempty"`
	Station             *UserStations            `json:"station,omitempty"`
	Authorization       *UserAuthorization       `json:"authorization,omitempty"`
	Employer            *EmployerInfo            `json:"employerInfo,omitempty"`
	Manager             *User                    `json:"manager,omitempty"`
	Certifications      []string                 `json:"certifications,omitempty"`
	Biography           *Biography               `json:"biography,omitempty"`
	ConversationSummary *UserConversationSummary `json:"conversationSummary,omitempty"`
	Locations           []*Location              `json:"locations,omitempty"`
	GeoLocation         *GeoLocation             `json:"geolocation,omitempty"`
	Chat                *Jabber                  `json:"chat,omitempty"`
	Version             int                      `json:"version"`

	Client *Client        `json:"-"`
	Logger *logger.Logger `json:"-"`
}

User describes a PureCloud User

func (User) GetID added in v0.1.0

func (user User) GetID() uuid.UUID

GetID gets the identifier of this

implements Identifiable

func (*User) Initialize added in v0.1.0

func (user *User) Initialize(parameters ...interface{}) error

Initialize initializes this from the given Client

implements Initializable
if the user ID is not given, /users/me is fetched (if grant allows)

func (User) String added in v0.1.0

func (user User) String() string

String gets a string version

implements the fmt.Stringer interface

type UserActivityTopic added in v0.1.0

type UserActivityTopic struct {
	Name          string
	User          *User
	Presence      *UserPresence
	RoutingStatus *RoutingStatus
	CorrelationID string
	ActiveQueues  []*Queue
	Client        *Client
}

UserActivityTopic describes a Topic about User's Activity

func (*UserActivityTopic) GetClient added in v0.1.0

func (topic *UserActivityTopic) GetClient() *Client

GetClient gets the PureCloud Client associated with this

func (UserActivityTopic) Match added in v0.1.0

func (topic UserActivityTopic) Match(topicName string) bool

Match tells if the given topicName matches this topic

func (*UserActivityTopic) Send added in v0.1.0

func (topic *UserActivityTopic) Send(channel *NotificationChannel)

Send sends the current topic to the Channel's chan

func (UserActivityTopic) String added in v0.1.0

func (topic UserActivityTopic) String() string

String gets a string version

implements the fmt.Stringer interface

func (UserActivityTopic) TopicFor added in v0.1.0

func (topic UserActivityTopic) TopicFor(identifiables ...Identifiable) string

TopicFor builds the topicName for the given identifiables

func (*UserActivityTopic) UnmarshalJSON added in v0.1.0

func (topic *UserActivityTopic) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

type UserAuthorization added in v0.1.0

type UserAuthorization struct {
	Roles              []*DomainRole               `json:"roles"`
	UnusedRoles        []*DomainRole               `json:"unusedRoles"`
	Permissions        []string                    `json:"permissions"`
	PermissionPolicies []*ResourcePermissionPolicy `json:"permissionPolicies"`
}

UserAuthorization desribes authorizations for a User

type UserConversationChatTopic added in v0.1.0

type UserConversationChatTopic struct {
	Name          string
	User          *User
	Conversation  *ConversationChat
	Participants  []*Participant
	CorrelationID string
	Client        *Client
}

UserConversationChatTopic describes a Topic about User's Presence

func (*UserConversationChatTopic) GetClient added in v0.1.0

func (topic *UserConversationChatTopic) GetClient() *Client

GetClient gets the PureCloud Client associated with this

func (UserConversationChatTopic) Match added in v0.1.0

func (topic UserConversationChatTopic) Match(topicName string) bool

Match tells if the given topicName matches this topic

func (*UserConversationChatTopic) Send added in v0.1.0

func (topic *UserConversationChatTopic) Send(channel *NotificationChannel)

Send sends the current topic to the Channel's chan

func (UserConversationChatTopic) String added in v0.1.0

func (topic UserConversationChatTopic) String() string

String gets a string version

implements the fmt.Stringer interface

func (UserConversationChatTopic) TopicFor added in v0.1.0

func (topic UserConversationChatTopic) TopicFor(identifiables ...Identifiable) string

TopicFor builds the topicName for the given identifiables

func (*UserConversationChatTopic) UnmarshalJSON added in v0.1.0

func (topic *UserConversationChatTopic) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

type UserConversationSummary added in v0.1.0

type UserConversationSummary struct {
	UserID           string       `json:"userId"`
	Call             MediaSummary `json:"call"`
	Callback         MediaSummary `json:"callback"`
	Email            MediaSummary `json:"email"`
	Message          MediaSummary `json:"message"`
	Chat             MediaSummary `json:"chat"`
	SocialExpression MediaSummary `json:"socialExpression"`
	Video            MediaSummary `json:"video"`
}

UserConversationSummary describes the summary of a User's conversations

type UserImage added in v0.1.0

type UserImage struct {
	ImageURL   *url.URL `json:"-"`
	Resolution string   `json:"resolution"`
}

UserImage represents a User's Avatar image

func (UserImage) MarshalJSON added in v0.1.0

func (userImage UserImage) MarshalJSON() ([]byte, error)

MarshalJSON marshals this into JSON

func (*UserImage) UnmarshalJSON added in v0.1.0

func (userImage *UserImage) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

type UserPresence added in v0.1.0

type UserPresence struct {
	ID           string              `json:"id"`
	Name         string              `json:"name"`
	Source       string              `json:"source"`
	Primary      bool                `json:"primary"`
	Definition   *PresenceDefinition `json:"presenceDefinition"`
	Message      string              `json:"message"`
	ModifiedDate time.Time           `json:"modifiedDate"`
	SelfURI      string              `json:"selfUri"`
}

UserPresence describes the Presence of a User

func (UserPresence) GetID added in v0.1.0

func (presence UserPresence) GetID() string

GetID gets the identifier of this

implements Identifiable

func (UserPresence) String added in v0.1.0

func (presence UserPresence) String() string

String gets a string version

implements the fmt.Stringer interface

func (*UserPresence) UnmarshalJSON added in v0.1.0

func (presence *UserPresence) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

type UserPresenceTopic added in v0.1.0

type UserPresenceTopic struct {
	Name          string
	User          *User
	Presence      UserPresence
	CorrelationID string
	Client        *Client
}

UserPresenceTopic describes a Topic about User's Presence

func (*UserPresenceTopic) GetClient added in v0.1.0

func (topic *UserPresenceTopic) GetClient() *Client

GetClient gets the PureCloud Client associated with this

func (UserPresenceTopic) Match added in v0.1.0

func (topic UserPresenceTopic) Match(topicName string) bool

Match tells if the given topicName matches this topic

func (*UserPresenceTopic) Send added in v0.1.0

func (topic *UserPresenceTopic) Send(channel *NotificationChannel)

Send sends the current topic to the Channel's chan

func (UserPresenceTopic) String added in v0.1.0

func (topic UserPresenceTopic) String() string

String gets a string version

implements the fmt.Stringer interface

func (UserPresenceTopic) TopicFor added in v0.1.0

func (topic UserPresenceTopic) TopicFor(identifiables ...Identifiable) string

TopicFor builds the topicName for the given identifiables

func (*UserPresenceTopic) UnmarshalJSON added in v0.1.0

func (topic *UserPresenceTopic) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

type UserRoutingLanguage added in v0.1.0

type UserRoutingLanguage struct {
	ID          string  `json:"id"`
	SelfURI     string  `json:"selfUri"`
	Name        string  `json:"name"`
	LanguageURI string  `json:"languageUri"`
	State       string  `json:"state"`
	Proficiency float64 `json:"proficiency"`
}

UserRoutingLanguage describe a Routing Language for a User

type UserRoutingSkill added in v0.1.0

type UserRoutingSkill struct {
	ID          string  `json:"id"`
	SelfURI     string  `json:"selfUri"`
	Name        string  `json:"name"`
	SkillURI    string  `json:"skillUri"`
	State       string  `json:"state"`
	Proficiency float64 `json:"proficiency"`
}

UserRoutingSkill describe a Routing Skill for a User

type UserStation added in v0.1.0

type UserStation struct {
	// TODO: Find out what should be here!
	ID             string            `json:"id"`
	SelfURI        string            `json:"selfUri,omitempty"`
	Name           string            `json:"name"`
	Type           string            `json:"type"`
	AssociatedUser *User             `json:"associatedUser"`
	AssociatedDate time.Time         `json:"associatedDate"`
	DefaultUser    *User             `json:"defaultUser"`
	ProviderInfo   map[string]string `json:"providerInfo"`
}

UserStation describes a User Station

type UserStations added in v0.1.0

type UserStations struct {
	AssociatedStation     *UserStation `json:"associatedStation"`
	LastAssociatedStation *UserStation `json:"lastAssociatedStation"`
	DefaultStation        *UserStation `json:"defaultStation"`
	EffectiveStation      *UserStation `json:"effectiveStation"`
}

UserStations describes the stations of a user

type VisibilityCondition added in v0.1.0

type VisibilityCondition struct {
	CombiningOperation string        `json:"combiningOperation"`
	Predicates         []interface{} `json:"predicates"`
}

VisibilityCondition describes visibility conditions

type Voicemail added in v0.1.0

type Voicemail struct {
	ID           string `json:"id"`
	UploadStatus string `json:"uploadStatus"`
}

Voicemail describes a voicemail

type Wrapup added in v0.1.0

type Wrapup struct {
	Name        string        `json:"name"`
	Code        string        `json:"code"`
	Notes       string        `json:"notes"`
	Tags        []string      `json:"tags"`
	Duration    time.Duration `json:"-"`
	EndTime     time.Time     `json:"endTime"`
	Provisional bool          `json:"provisional"`
}

Wrapup describes a Wrapup

func (Wrapup) MarshalJSON added in v0.1.0

func (wrapup Wrapup) MarshalJSON() ([]byte, error)

MarshalJSON marshals this into JSON

func (*Wrapup) UnmarshalJSON added in v0.1.0

func (wrapup *Wrapup) UnmarshalJSON(payload []byte) (err error)

UnmarshalJSON unmarshals JSON into this

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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