manager

package module
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

README

manager-sdk-go

Go SDK for the babelforce manager APIs — auth, user & agent management, call reporting, metrics, and task automations.

One client, configured once, exposes resource namespaces over the API. Authentication, paging, and error handling are handled for you.

📖 Docs: https://babelforce.github.io/manager-sdk/

Install

go get github.com/babelforce/manager-sdk-go
import manager "github.com/babelforce/manager-sdk-go"

Usage

mgr, err := manager.Connect(ctx, manager.Options{
    Auth: manager.APIKey(accessID, accessToken), // or manager.Password(user, pass)
    // BaseURL defaults to https://services.babelforce.com
})
if err != nil {
    log.Fatal(err)
}

// list users (auto-paginated)
for user, err := range mgr.Users.List(ctx, manager.ListUsersQuery{}) {
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println(user.Email)
}

_, err = mgr.Users.Create(ctx, manager.CreateManagedUserRequest{Email: "new.user@acme.com"})
Authentication
  • manager.APIKey(id, token) — sends X-Auth-Access-Id / X-Auth-Access-Token.
  • manager.Bearer(token) — a token you already hold.
  • manager.Password(user, pass) — OAuth2 password grant with transparent refresh.
Errors

Non-2xx responses return a typed *manager.APIError (Status, Code, Message, Body).

Custom host
manager.Connect(ctx, manager.Options{
    BaseURL: "https://acme.babelforce.com",
    Auth:    manager.Bearer(token),
})

License

Apache-2.0

Documentation

Overview

Package manager is the babelforce manager SDK for Go.

It provides an intuitive, hand-written client over the babelforce manager APIs — auth, user & agent management, call reporting, metrics, and task automations. Configure one ManagerClient with Connect, authenticate once, and use its resource namespaces.

mgr, err := manager.Connect(ctx, manager.Options{
    Auth: manager.APIKey(accessID, accessToken),
})
for user, err := range mgr.Users.List(ctx, manager.ListUsersQuery{}) {
    if err != nil { return err }
    fmt.Println(user.Email)
}

The low-level clients under gen/ are generated from the OpenAPI specs and are an internal detail; this package is the public surface.

Index

Constants

View Source
const DefaultBaseURL = "https://services.babelforce.com"

DefaultBaseURL is the babelforce API host used when Options.BaseURL is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	// Status is the HTTP status code.
	Status int
	// Code is the API error code, when the body carries one.
	Code string
	// Message is a human-readable message (from the body when available, else the status text).
	Message string
	// Body is the raw response body.
	Body []byte
}

APIError is returned when the manager API responds with a non-2xx status.

func (*APIError) Error

func (e *APIError) Error() string

type AgentGroupsResource added in v0.3.0

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

AgentGroupsResource is the agent-groups namespace (/api/v2/agents/groups).

func (*AgentGroupsResource) AddAgent added in v0.3.0

func (r *AgentGroupsResource) AddAgent(ctx context.Context, groupID, agentID string) (*managerapi.AgentGroupAdditionResponse, error)

AddAgent adds an agent (by id) to a group.

func (*AgentGroupsResource) Create added in v0.3.0

Create creates an agent group.

func (*AgentGroupsResource) Delete added in v0.3.0

func (r *AgentGroupsResource) Delete(ctx context.Context, id string) error

Delete deletes an agent group by id.

func (*AgentGroupsResource) Get added in v0.3.0

Get returns an agent group by id.

func (*AgentGroupsResource) List added in v0.3.0

List returns an iterator over agent groups, auto-paginating across pages.

func (*AgentGroupsResource) ListAll added in v0.3.0

func (r *AgentGroupsResource) ListAll(ctx context.Context, pageSize int) ([]managerapi.AgentGroup, error)

ListAll collects every agent group into a slice (convenience over List).

func (*AgentGroupsResource) Update added in v0.3.0

Update updates an agent group.

type AgentsResource added in v0.3.0

type AgentsResource struct {

	// Groups is the agent-groups sub-namespace (/api/v2/agents/groups).
	Groups *AgentGroupsResource
	// contains filtered or unexported fields
}

AgentsResource is the agent-management namespace (/api/v2/agents).

func (*AgentsResource) Create added in v0.3.0

Create creates an agent.

func (*AgentsResource) Delete added in v0.3.0

func (r *AgentsResource) Delete(ctx context.Context, id string) error

Delete deletes an agent by id.

func (*AgentsResource) Get added in v0.3.0

Get returns an agent by id.

func (*AgentsResource) List added in v0.3.0

List returns an iterator over agents, auto-paginating across pages.

for agent, err := range mgr.Agents.List(ctx, manager.ListAgentsQuery{}) {
    if err != nil { return err }
    fmt.Println(agent.Name)
}

func (*AgentsResource) ListAll added in v0.3.0

ListAll collects every agent into a slice (convenience over List).

func (*AgentsResource) Update added in v0.3.0

Update updates an agent.

func (*AgentsResource) UpdateStatus added in v0.3.0

UpdateStatus updates an agent's status (enabled flag and/or presence).

type AppActionsResource added in v0.4.0

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

AppActionsResource is the per-application actions (local automations) namespace (/api/v2/applications/{applicationId}/actions).

func (*AppActionsResource) Create added in v0.4.0

Create creates an action in an application.

func (*AppActionsResource) Delete added in v0.4.0

func (r *AppActionsResource) Delete(ctx context.Context, applicationID, id string) error

Delete deletes one of an application's actions.

func (*AppActionsResource) Get added in v0.4.0

Get returns one of an application's actions by id.

func (*AppActionsResource) List added in v0.4.0

func (r *AppActionsResource) List(ctx context.Context, applicationID string, pageSize int) iter.Seq2[managerapi.LocalAutomation, error]

List returns an iterator over an application's actions, auto-paginating across pages.

func (*AppActionsResource) ListAll added in v0.4.0

func (r *AppActionsResource) ListAll(ctx context.Context, applicationID string, pageSize int) ([]managerapi.LocalAutomation, error)

ListAll collects every action of an application into a slice (convenience over List).

func (*AppActionsResource) Update added in v0.4.0

Update updates one of an application's actions.

type ApplicationView added in v0.5.0

type ApplicationView struct {
	Id          string           `json:"id"`
	Name        string           `json:"name"`
	Module      string           `json:"module"`
	Enabled     bool             `json:"enabled"`
	DateCreated time.Time        `json:"dateCreated"`
	LastUpdated time.Time        `json:"lastUpdated"`
	Tags        []managerapi.Tag `json:"tags"`
}

ApplicationView holds the fields every IVR application variant shares, regardless of its module. managerapi.Application is a oneOf union (a distinct shape per module), so it carries no directly addressable fields; use ApplicationViewOf to read the common ones. For module-specific fields (routings, settings, …) use the generated app.As<Module>Application() accessors or app.ValueByDiscriminator().

func ApplicationViewOf added in v0.5.0

func ApplicationViewOf(app managerapi.Application) (ApplicationView, error)

ApplicationViewOf extracts the fields common to every Application variant. It also works on the Application returned inside ApplicationItemResponse.Item (Get/Create/Update).

type ApplicationsResource added in v0.4.0

type ApplicationsResource struct {

	// Actions is the per-application actions (local automations) sub-namespace
	// (/api/v2/applications/{applicationId}/actions).
	Actions *AppActionsResource
	// contains filtered or unexported fields
}

ApplicationsResource is the application (IVR) management namespace (/api/v2/applications).

func (*ApplicationsResource) Create added in v0.4.0

Create creates an application.

func (*ApplicationsResource) Delete added in v0.4.0

func (r *ApplicationsResource) Delete(ctx context.Context, id string) error

Delete deletes an application by id.

func (*ApplicationsResource) DeleteMany added in v0.4.0

DeleteMany bulk-deletes applications by id.

func (*ApplicationsResource) Dispatch added in v0.4.0

Dispatch dispatches the local automations configured at a position in an application. The body is optional: pass nil to send no request payload, or a non-nil *LocalAutomationDispatch to send one.

func (*ApplicationsResource) Get added in v0.4.0

Get returns an application by id.

func (*ApplicationsResource) List added in v0.4.0

List returns an iterator over applications, auto-paginating across pages.

for app, err := range mgr.Applications.List(ctx, manager.ListApplicationsQuery{}) {
    if err != nil { return err }
    v, _ := manager.ApplicationViewOf(app)
    fmt.Println(v.Id, v.Name, v.Module)
}

func (*ApplicationsResource) ListAll added in v0.4.0

ListAll collects every application into a slice (convenience over List).

func (*ApplicationsResource) ListModules added in v0.4.0

ListModules lists the available IVR modules (the building blocks of applications).

func (*ApplicationsResource) Update added in v0.4.0

Update updates an application.

type AuditSettings added in v0.4.0

AuditSettings groups the `audit` settings.

type Auth

type Auth interface {
	// contains filtered or unexported methods
}

Auth describes how the SDK authenticates. Construct one with APIKey, Bearer, or Password.

func APIKey

func APIKey(accessID, accessToken string) Auth

APIKey authenticates with the X-Auth-Access-Id / X-Auth-Access-Token header pair (the primary server-to-server mode).

func Bearer

func Bearer(token string) Auth

Bearer authenticates with a bearer token you already hold.

func Password

func Password(user, pass string) Auth

Password authenticates via the OAuth2 password grant against /oauth/token. The token is fetched lazily on first use and refreshed transparently before it expires. Convenience for interactive/dev use.

type AutomationsResource added in v0.17.0

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

AutomationsResource is the global-automations namespace (event triggers, /api/v2/events/triggers).

List takes the generated parameter struct directly; the Page field is managed by the auto-paginator, so leave it unset.

func (*AutomationsResource) Create added in v0.17.0

Create creates a global automation.

func (*AutomationsResource) Delete added in v0.17.0

func (r *AutomationsResource) Delete(ctx context.Context, id string) error

Delete deletes a global automation.

func (*AutomationsResource) Get added in v0.17.0

Get returns a global automation by id.

func (*AutomationsResource) List added in v0.17.0

List returns an iterator over global automations, auto-paginating across pages.

func (*AutomationsResource) ListAll added in v0.17.0

ListAll collects every global automation into a slice (convenience over List).

func (*AutomationsResource) Update added in v0.17.0

Update updates a global automation.

type BabeldeskResource added in v0.17.0

type BabeldeskResource struct {

	// Widgets is the babeldesk-widgets sub-namespace (/api/v2/babeldesk/widgets).
	Widgets *BabeldeskWidgetsResource
	// contains filtered or unexported fields
}

BabeldeskResource is the babeldesk-dashboards namespace (/api/v2/babeldesk/dashboards), with a nested Widgets sub-resource.

func (*BabeldeskResource) Create added in v0.17.0

Create creates a dashboard.

func (*BabeldeskResource) Delete added in v0.17.0

func (r *BabeldeskResource) Delete(ctx context.Context, id string) error

Delete deletes a dashboard.

func (*BabeldeskResource) Get added in v0.17.0

Get returns a dashboard by id.

func (*BabeldeskResource) List added in v0.17.0

List returns an iterator over babeldesk dashboards, auto-paginating across pages.

func (*BabeldeskResource) ListAll added in v0.17.0

ListAll collects every dashboard into a slice (convenience over List).

func (*BabeldeskResource) Update added in v0.17.0

Update updates a dashboard.

type BabeldeskWidgetsResource added in v0.17.0

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

BabeldeskWidgetsResource is the babeldesk-widgets namespace (/api/v2/babeldesk/widgets).

func (*BabeldeskWidgetsResource) Create added in v0.17.0

Create creates a widget.

func (*BabeldeskWidgetsResource) Delete added in v0.17.0

Delete deletes a widget.

func (*BabeldeskWidgetsResource) Get added in v0.17.0

Get returns a widget by id.

func (*BabeldeskWidgetsResource) List added in v0.17.0

List returns an iterator over widgets, auto-paginating across pages.

func (*BabeldeskWidgetsResource) ListAll added in v0.17.0

ListAll collects every widget into a slice (convenience over List).

func (*BabeldeskWidgetsResource) Update added in v0.17.0

Update updates a widget.

type BusinessHoursResource added in v0.17.0

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

BusinessHoursResource is the business-hours namespace (/api/v2/business-hours).

List takes the generated parameter struct directly; the Page field is managed by the auto-paginator, so leave it unset.

func (*BusinessHoursResource) Create added in v0.17.0

Create creates a business-hours definition.

func (*BusinessHoursResource) Delete added in v0.17.0

func (r *BusinessHoursResource) Delete(ctx context.Context, id string) error

Delete deletes a business-hours definition.

func (*BusinessHoursResource) Get added in v0.17.0

Get returns a business-hours definition by id.

func (*BusinessHoursResource) List added in v0.17.0

List returns an iterator over business-hours definitions, auto-paginating across pages.

func (*BusinessHoursResource) ListAll added in v0.17.0

ListAll collects every business-hours definition into a slice (convenience over List).

func (*BusinessHoursResource) Update added in v0.17.0

Update updates a business-hours definition.

type CalendarsResource added in v0.17.0

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

CalendarsResource is the calendars namespace (/api/v2/calendars), with calendar dates.

List takes the generated parameter struct directly; the Page field is managed by the auto-paginator, so leave it unset.

func (*CalendarsResource) AddDate added in v0.17.0

func (r *CalendarsResource) AddDate(ctx context.Context, id string) error

AddDate adds a date to a calendar.

func (*CalendarsResource) Create added in v0.17.0

Create creates a calendar.

func (*CalendarsResource) Delete added in v0.17.0

func (r *CalendarsResource) Delete(ctx context.Context, id string) error

Delete deletes a calendar.

func (*CalendarsResource) Get added in v0.17.0

Get returns a calendar by id.

func (*CalendarsResource) GetDates added in v0.17.0

func (r *CalendarsResource) GetDates(ctx context.Context, id string) ([]byte, error)

GetDates returns a calendar's dates as the raw response body.

func (*CalendarsResource) List added in v0.17.0

List returns an iterator over calendars, auto-paginating across pages.

func (*CalendarsResource) ListAll added in v0.17.0

ListAll collects every calendar into a slice (convenience over List).

func (*CalendarsResource) Update added in v0.17.0

Update updates a calendar.

type CallsResource added in v0.3.0

type CallsResource struct {
	// Reporting is the call-reporting sub-namespace (/api/v2/calls/reporting).
	Reporting *ReportingResource
	// contains filtered or unexported fields
}

CallsResource is the call namespace (/api/v2/calls): call reporting plus call control.

func (*CallsResource) CreateTestCall added in v0.17.0

CreateTestCall creates an inbound test call.

func (*CallsResource) Get added in v0.17.0

Get returns a single call by id.

func (*CallsResource) Hangup added in v0.17.0

Hangup hangs up a live call and returns the updated call.

func (*CallsResource) SetSessionVariables added in v0.17.0

SetSessionVariables sets session variables on a call.

type CampaignsResource added in v0.17.0

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

CampaignsResource is the outbound-campaigns namespace (/api/v2/outbound/campaigns).

func (*CampaignsResource) Create added in v0.17.0

Create creates a campaign.

func (*CampaignsResource) Delete added in v0.17.0

func (r *CampaignsResource) Delete(ctx context.Context, id string) error

Delete deletes a campaign.

func (*CampaignsResource) Get added in v0.17.0

Get returns a campaign by id.

func (*CampaignsResource) List added in v0.17.0

List returns all outbound campaigns.

func (*CampaignsResource) Update added in v0.17.0

Update updates a campaign.

type ConferencesResource added in v0.17.0

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

ConferencesResource is the conferences namespace (/api/v2/conferences).

List takes the generated parameter struct directly; the Page field is managed by the auto-paginator, so leave it unset.

func (*ConferencesResource) Get added in v0.17.0

Get returns a single conference by id.

func (*ConferencesResource) List added in v0.17.0

List returns an iterator over conferences, auto-paginating across pages.

func (*ConferencesResource) ListAll added in v0.17.0

ListAll collects every conference into a slice (convenience over List).

type ConversationsResource added in v0.17.0

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

ConversationsResource is the conversations namespace (/api/v2/conversations), with events and session variables.

List takes the generated parameter struct directly; the Page field is managed by the auto-paginator, so leave it unset.

func (*ConversationsResource) Create added in v0.17.0

Create creates a conversation.

func (*ConversationsResource) Delete added in v0.17.0

func (r *ConversationsResource) Delete(ctx context.Context, id string) error

Delete deletes a conversation.

func (*ConversationsResource) Events added in v0.17.0

func (r *ConversationsResource) Events(ctx context.Context, conversationID string) ([]managerapi.ConversationEvent, error)

Events returns a conversation's events.

func (*ConversationsResource) Get added in v0.17.0

Get returns a conversation by id.

func (*ConversationsResource) GetEvent added in v0.17.0

GetEvent returns a single conversation event.

func (*ConversationsResource) GetSession added in v0.17.0

GetSession returns a conversation's session variables.

func (*ConversationsResource) List added in v0.17.0

List returns an iterator over conversations, auto-paginating across pages.

func (*ConversationsResource) ListAll added in v0.17.0

ListAll collects every conversation into a slice (convenience over List).

func (*ConversationsResource) Update added in v0.17.0

Update updates a conversation.

func (*ConversationsResource) UpdateSession added in v0.17.0

UpdateSession updates a conversation's session variables.

type EventsResource added in v0.17.0

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

EventsResource is the events namespace (/api/v2/events): event definitions and custom events.

func (*EventsResource) CreateCustom added in v0.17.0

CreateCustom creates a custom event.

func (*EventsResource) DeleteCustom added in v0.17.0

func (r *EventsResource) DeleteCustom(ctx context.Context, id string) error

DeleteCustom deletes a custom event.

func (*EventsResource) List added in v0.17.0

func (r *EventsResource) List(ctx context.Context) ([]managerapi.Event, error)

List returns the available event definitions.

type ExpressionsResource added in v0.17.0

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

ExpressionsResource is the expressions namespace (/api/v2/expressions): catalog and evaluation.

func (*ExpressionsResource) Evaluate added in v0.17.0

Evaluate evaluates an expression against a sample context. async dispatches automations asynchronously.

func (*ExpressionsResource) List added in v0.17.0

List returns the available expressions.

type IntegrationsResource added in v0.17.0

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

IntegrationsResource is the integrations namespace (/api/v2/integrations).

List takes the generated parameter struct directly; the Page field is managed by the auto-paginator, so leave it unset.

func (*IntegrationsResource) ActionVariables added in v0.17.0

ActionVariables lists the variables a single provider action exposes.

func (*IntegrationsResource) AddAssociation added in v0.17.0

func (r *IntegrationsResource) AddAssociation(ctx context.Context, integrationID, associationID, actionName string) (*managerapi.IntegrationAddAssociationResponse, error)

AddAssociation associates an integration action with an object.

func (*IntegrationsResource) Available added in v0.17.0

Available lists the integration providers available to this account.

func (*IntegrationsResource) Create added in v0.17.0

Create creates an integration.

func (*IntegrationsResource) Delete added in v0.17.0

func (r *IntegrationsResource) Delete(ctx context.Context, id string) error

Delete deletes an integration.

func (*IntegrationsResource) DispatchAction added in v0.17.0

DispatchAction dispatches an integration action.

func (*IntegrationsResource) Get added in v0.17.0

Get returns an integration by id.

func (*IntegrationsResource) List added in v0.17.0

List returns an iterator over configured integrations, auto-paginating across pages.

func (*IntegrationsResource) ListAll added in v0.17.0

ListAll collects every integration into a slice (convenience over List).

ProviderLogo returns a provider's logo at a given size.

func (*IntegrationsResource) ProviderSessionVariables added in v0.17.0

ProviderSessionVariables lists the session variables a provider's actions expose.

func (*IntegrationsResource) RemoveAssociation added in v0.17.0

func (r *IntegrationsResource) RemoveAssociation(ctx context.Context, integrationID, associationID, actionName string) (*managerapi.IntegrationRemoveAssociationResponse, error)

RemoveAssociation removes an integration action association.

func (*IntegrationsResource) Update added in v0.17.0

Update updates an integration.

type InterruptTarget added in v0.2.0

InterruptTarget is the state a manager-interrupt transitions a task to.

type ListAgentsQuery added in v0.3.0

type ListAgentsQuery struct {
	// Q searches name, group name, number, email, sourceId and integration label at once.
	Q *string
	// Enabled restricts to enabled (true) or disabled (false) agents.
	Enabled *bool
	// Name filters by agent name.
	Name *string
	// Number filters by the agent's number.
	Number *string
	// SourceId filters by integration source id.
	SourceId *string
	// State filters by line status.
	State *managerapi.AgentLineStatus
	// Source filters by source integration.
	Source *string
	// GroupIds restricts to agents in these group id(s).
	GroupIds []string
	// PageSize is the page size (the API's max). Zero uses the server default.
	PageSize int
}

ListAgentsQuery filters an agent listing.

type ListApplicationsQuery added in v0.4.0

type ListApplicationsQuery struct {
	// PageSize is the page size (the API's max). Zero uses the server default.
	PageSize int
}

ListApplicationsQuery filters an application listing.

type ListTasksQuery added in v0.2.0

type ListTasksQuery struct {
	// Filter is a server-side filter expression.
	Filter *string
	// PageSize is the page size (1..100); defaults to 100.
	PageSize int
}

ListTasksQuery filters a task listing.

type ListUsersQuery

type ListUsersQuery struct {
	// Email filters by email address.
	Email *string
}

ListUsersQuery filters a user listing.

type LogsResource added in v0.17.0

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

LogsResource is the logs namespace: request audit logs (/api/v2/audit) and live logs (/api/v2/logs).

func (*LogsResource) Audit added in v0.17.0

Audit returns an iterator over request audit-log entries, auto-paginating across pages.

func (*LogsResource) AuditAll added in v0.17.0

AuditAll collects every audit-log entry into a slice (convenience over Audit).

func (*LogsResource) Live added in v0.17.0

func (r *LogsResource) Live(ctx context.Context) ([]managerapi.LiveLog, error)

Live returns the current live logs.

type ManagerClient

type ManagerClient struct {
	// Users is the user-management namespace (/api/v2/users).
	Users *UsersResource
	// Me is the authenticated-principal namespace (/api/v2/user): current user, accounts.
	Me *MeResource
	// Agents is the agent-management namespace (/api/v2/agents).
	Agents *AgentsResource
	// Calls is the call namespace (/api/v2/calls): reporting and call control.
	Calls *CallsResource
	// Sms is the SMS-records namespace (/api/v2/sms).
	Sms *SmsResource
	// Numbers is the service-numbers namespace (/api/v2/numbers).
	Numbers *NumbersResource
	// Conferences is the conferences namespace (/api/v2/conferences).
	Conferences *ConferencesResource
	// Queues is the queues namespace (/api/v2/queues), including selections.
	Queues *QueuesResource
	// Routing is the routing-rules namespace (/api/v2/routings).
	Routing *RoutingResource
	// Triggers is the workflow-triggers namespace (/api/v2/triggers).
	Triggers *TriggersResource
	// Automations is the global-automations namespace (/api/v2/events/triggers).
	Automations *AutomationsResource
	// Integrations is the integrations namespace (/api/v2/integrations).
	Integrations *IntegrationsResource
	// Outbound is the outbound dialer-lists namespace (/api/v2/outbound/lists).
	Outbound *OutboundResource
	// Phonebook is the phonebook-entries namespace (/api/v2/phonebook).
	Phonebook *PhonebookResource
	// Campaigns is the outbound-campaigns namespace (/api/v2/outbound/campaigns).
	Campaigns *CampaignsResource
	// BusinessHours is the business-hours namespace (/api/v2/business-hours).
	BusinessHours *BusinessHoursResource
	// Calendars is the calendars namespace (/api/v2/calendars).
	Calendars *CalendarsResource
	// Conversations is the conversations namespace (/api/v2/conversations).
	Conversations *ConversationsResource
	// Sessions is the call/automation-sessions namespace (/api/v2/sessions).
	Sessions *SessionsResource
	// Prompts is the audio-prompts namespace (/api/v2/prompts).
	Prompts *PromptsResource
	// Babeldesk is the babeldesk namespace (/api/v2/babeldesk): dashboards and widgets.
	Babeldesk *BabeldeskResource
	// Events is the events namespace (/api/v2/events): definitions and custom events.
	Events *EventsResource
	// Logs is the logs namespace: request audit logs (/api/v2/audit) and live logs (/api/v2/logs).
	Logs *LogsResource
	// Expressions is the expressions namespace (/api/v2/expressions): catalog and evaluation.
	Expressions *ExpressionsResource
	// Metrics is the metrics namespace (/api/v2/metrics).
	Metrics *MetricsResource
	// Applications is the application (IVR) management namespace (/api/v2/applications).
	Applications *ApplicationsResource
	// Settings is the global-settings namespace (/api/v2/settings).
	Settings *SettingsResource
	// Tasks is the task-automation namespace (/api/v3/tasks).
	Tasks *TasksResource
}

ManagerClient is the babelforce manager SDK client. Create one with Connect.

func Connect

func Connect(_ context.Context, opts Options) (*ManagerClient, error)

Connect creates and configures a client.

type MeResource added in v0.17.0

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

MeResource is the authenticated-principal namespace (/api/v2/user): the current user, the accounts they can access, and self-service password reset.

func (*MeResource) Accounts added in v0.17.0

func (r *MeResource) Accounts(ctx context.Context) ([]userapi.Account, error)

Accounts lists the accounts the current user can access.

func (*MeResource) Customer added in v0.17.0

Customer returns the current user together with their account (customer) information.

func (*MeResource) Get added in v0.17.0

Get returns the current user.

func (*MeResource) ResetPassword added in v0.17.0

func (r *MeResource) ResetPassword(ctx context.Context) error

ResetPassword requests a password-reset email for the current user.

type MetricsResource added in v0.3.0

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

MetricsResource is the metrics namespace (/api/v2/metrics).

func (*MetricsResource) Describe added in v0.3.0

Describe returns a metric's definition by id.

func (*MetricsResource) Get added in v0.3.0

Get returns a metric's current value by id.

func (*MetricsResource) ListIds added in v0.3.0

ListIds lists the available metric ids.

func (*MetricsResource) Push added in v0.3.0

Push triggers a metrics push.

func (*MetricsResource) Reset added in v0.3.0

Reset resets the metric counters.

type NumbersResource added in v0.17.0

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

NumbersResource is the service-numbers namespace (/api/v2/numbers).

List takes the generated parameter struct directly; the Page field is managed by the auto-paginator, so leave it unset.

func (*NumbersResource) AddTags added in v0.17.0

AddTags adds tags to a service number and returns the updated number.

func (*NumbersResource) Get added in v0.17.0

Get returns a single service number by id.

func (*NumbersResource) List added in v0.17.0

List returns an iterator over service numbers, auto-paginating across pages.

func (*NumbersResource) ListAll added in v0.17.0

ListAll collects every service number into a slice (convenience over List).

type Options

type Options struct {
	// BaseURL is the base URL of the babelforce API. Defaults to [DefaultBaseURL].
	BaseURL string
	// Auth is how the client authenticates. Required.
	Auth Auth
	// HTTPClient is the underlying HTTP client. Defaults to http.DefaultClient.
	HTTPClient *http.Client
	// Retry tunes automatic retries. Nil uses sensible defaults (see [RetryPolicy]); set
	// &RetryPolicy{MaxRetries: 0} to disable.
	Retry *RetryPolicy
}

Options configures a ManagerClient.

type OutboundResource added in v0.17.0

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

OutboundResource is the outbound dialer-lists namespace (/api/v2/outbound/lists), with leads.

func (*OutboundResource) AddLead added in v0.17.0

AddLead adds a lead to an outbound list.

func (*OutboundResource) ClearList added in v0.17.0

ClearList removes all leads from an outbound list and returns the (now empty) list.

func (*OutboundResource) CreateList added in v0.17.0

CreateList creates an outbound list.

func (*OutboundResource) DeleteLead added in v0.17.0

func (r *OutboundResource) DeleteLead(ctx context.Context, listID, leadID string) error

DeleteLead removes a lead from an outbound list.

func (*OutboundResource) Lists added in v0.17.0

Lists returns all outbound lists.

func (*OutboundResource) UpdateLead added in v0.17.0

UpdateLead updates a lead in an outbound list.

type PhonebookResource added in v0.17.0

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

PhonebookResource is the phonebook-entries namespace (/api/v2/phonebook), with bulk CSV download/upload.

List takes the generated parameter struct directly; the Page field is managed by the auto-paginator, so leave it unset.

func (*PhonebookResource) Create added in v0.17.0

Create creates a phonebook entry.

func (*PhonebookResource) Delete added in v0.17.0

func (r *PhonebookResource) Delete(ctx context.Context, id string) error

Delete deletes a phonebook entry.

func (*PhonebookResource) Download added in v0.17.0

func (r *PhonebookResource) Download(ctx context.Context) ([]byte, error)

Download returns all phonebook entries as a raw CSV export (bulk).

func (*PhonebookResource) Get added in v0.17.0

Get returns a phonebook entry by id.

func (*PhonebookResource) List added in v0.17.0

List returns an iterator over phonebook entries, auto-paginating across pages.

func (*PhonebookResource) ListAll added in v0.17.0

ListAll collects every phonebook entry into a slice (convenience over List).

func (*PhonebookResource) Update added in v0.17.0

Update updates a phonebook entry.

func (*PhonebookResource) Upload added in v0.17.0

func (r *PhonebookResource) Upload(ctx context.Context, contentType string, body io.Reader) error

Upload imports phonebook entries from a CSV stream (bulk). contentType is e.g. "text/csv".

type PromptsResource added in v0.17.0

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

PromptsResource is the audio-prompts namespace (/api/v2/prompts).

List takes the generated parameter struct directly; the Page field is managed by the auto-paginator, so leave it unset.

func (*PromptsResource) Delete added in v0.17.0

func (r *PromptsResource) Delete(ctx context.Context, id string) error

Delete deletes a prompt.

func (*PromptsResource) Get added in v0.17.0

Get returns a prompt by id.

func (*PromptsResource) List added in v0.17.0

List returns an iterator over prompts, auto-paginating across pages.

func (*PromptsResource) ListAll added in v0.17.0

ListAll collects every prompt into a slice (convenience over List).

func (*PromptsResource) Update added in v0.17.0

Update updates a prompt's metadata.

func (*PromptsResource) Upload added in v0.17.0

func (r *PromptsResource) Upload(ctx context.Context, contentType string, body io.Reader) (*managerapi.PromptItemResponse, error)

Upload uploads a new audio prompt from a stream. contentType is e.g. "audio/wav".

type QueueSelectionsResource added in v0.17.0

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

QueueSelectionsResource is queue selections (routing rules) and their agent/group/tag membership.

func (*QueueSelectionsResource) AddAgent added in v0.17.0

func (r *QueueSelectionsResource) AddAgent(ctx context.Context, queueID, selectionID, agentID string) (*managerapi.QueueSelectionModificationResponse, error)

AddAgent adds an agent to a selection.

func (*QueueSelectionsResource) AddGroup added in v0.17.0

func (r *QueueSelectionsResource) AddGroup(ctx context.Context, queueID, selectionID, groupID string) (*managerapi.QueueSelectionModificationResponse, error)

AddGroup adds an agent group to a selection.

func (*QueueSelectionsResource) AddTag added in v0.17.0

func (r *QueueSelectionsResource) AddTag(ctx context.Context, queueID, selectionID, tagID string) (*managerapi.QueueSelectionModificationResponse, error)

AddTag adds a tag to a selection.

func (*QueueSelectionsResource) Create added in v0.17.0

Create creates a selection on a queue.

func (*QueueSelectionsResource) Delete added in v0.17.0

func (r *QueueSelectionsResource) Delete(ctx context.Context, queueID, id string) error

Delete deletes a selection.

func (*QueueSelectionsResource) Get added in v0.17.0

Get returns a selection.

func (*QueueSelectionsResource) List added in v0.17.0

List returns an iterator over a queue's selections, auto-paginating across pages.

func (*QueueSelectionsResource) ListAll added in v0.17.0

ListAll collects every selection for a queue into a slice (convenience over List).

func (*QueueSelectionsResource) RemoveAgent added in v0.17.0

func (r *QueueSelectionsResource) RemoveAgent(ctx context.Context, queueID, selectionID, id string) (*managerapi.QueueSelectionModificationResponse, error)

RemoveAgent removes an agent from a selection.

func (*QueueSelectionsResource) RemoveGroup added in v0.17.0

func (r *QueueSelectionsResource) RemoveGroup(ctx context.Context, queueID, selectionID, id string) (*managerapi.QueueSelectionModificationResponse, error)

RemoveGroup removes an agent group from a selection.

func (*QueueSelectionsResource) RemoveTag added in v0.17.0

func (r *QueueSelectionsResource) RemoveTag(ctx context.Context, queueID, selectionID, id string) (*managerapi.QueueSelectionModificationResponse, error)

RemoveTag removes a tag from a selection.

func (*QueueSelectionsResource) SelectAgents added in v0.17.0

SelectAgents resolves the agents currently selected for a queue.

func (*QueueSelectionsResource) Update added in v0.17.0

Update updates a selection.

type QueuesResource added in v0.17.0

type QueuesResource struct {

	// Selections is the queue-selections sub-namespace (/api/v2/queues/{queueId}/selections).
	Selections *QueueSelectionsResource
	// contains filtered or unexported fields
}

QueuesResource is the queues namespace (/api/v2/queues), with a nested Selections sub-resource.

List takes the generated parameter struct directly; the Page field is managed by the auto-paginator, so leave it unset.

func (*QueuesResource) Create added in v0.17.0

Create creates a queue.

func (*QueuesResource) Delete added in v0.17.0

func (r *QueuesResource) Delete(ctx context.Context, id string) error

Delete deletes a queue.

func (*QueuesResource) Get added in v0.17.0

Get returns a queue by id.

func (*QueuesResource) List added in v0.17.0

List returns an iterator over queues, auto-paginating across pages.

func (*QueuesResource) ListAll added in v0.17.0

ListAll collects every queue into a slice (convenience over List).

func (*QueuesResource) Update added in v0.17.0

Update updates a queue.

type ReportingResource added in v0.3.0

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

ReportingResource is the call-reporting namespace (/api/v2/calls/reporting).

The list methods take the generated parameter structs directly (every filter is an optional pointer field); the Page field is managed by the auto-paginator, so leave it unset.

func (*ReportingResource) List added in v0.3.0

List returns an iterator over the detailed call report, auto-paginating across pages.

for call, err := range mgr.Calls.Reporting.List(ctx, managerapi.ListReportingCallsParams{}) {
    if err != nil { return err }
    fmt.Println(call.Id)
}

func (*ReportingResource) ListAll added in v0.3.0

ListAll collects every call from the detailed report into a slice (convenience over List).

func (*ReportingResource) Simple added in v0.3.0

Simple returns an iterator over the simple call report across all report types (/api/v2/calls/reporting/simple), auto-paginating across pages.

func (*ReportingResource) SimpleAll added in v0.3.0

SimpleAll collects every call from the simple report into a slice (convenience over Simple).

func (*ReportingResource) SimpleAllByType added in v0.3.0

SimpleAllByType collects every call from a single report type into a slice.

func (*ReportingResource) SimpleByType added in v0.3.0

SimpleByType returns an iterator over the simple call report for a single report type (/api/v2/calls/reporting/simple/{reportType}), auto-paginating across pages.

type RetentionSettings added in v0.4.0

RetentionSettings groups the `retention` settings.

type RetryPolicy added in v0.17.0

type RetryPolicy struct {
	// MaxRetries is the number of retry attempts after the initial request. Default 2; 0 disables.
	MaxRetries int
	// BaseDelay is the base backoff; it grows exponentially per attempt. Default 250ms.
	BaseDelay time.Duration
	// MaxDelay caps any single backoff and also caps Retry-After. Default 10s.
	MaxDelay time.Duration
	// RetryStatus is the set of response status codes that trigger a retry.
	// Default: 429, 502, 503, 504.
	RetryStatus []int
}

RetryPolicy tunes automatic request retries. Transient failures — network errors and a small set of "try again" status codes (429/502/503/504 by default) — are retried with exponential backoff and jitter, honouring a Retry-After header when present.

Retries are on by default with conservative settings (see Connect). To customise, set Options.Retry; zero-valued delay/status fields fall back to the defaults, but MaxRetries is taken literally — set it to 0 to disable retries.

type RoutingResource added in v0.17.0

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

RoutingResource is the routing-rules namespace (/api/v2/routings).

List takes the generated parameter struct directly; the Page field is managed by the auto-paginator, so leave it unset.

func (*RoutingResource) Create added in v0.17.0

Create creates a routing.

func (*RoutingResource) Delete added in v0.17.0

func (r *RoutingResource) Delete(ctx context.Context, id string) error

Delete deletes a routing.

func (*RoutingResource) Get added in v0.17.0

Get returns a routing by id.

func (*RoutingResource) List added in v0.17.0

List returns an iterator over routings, auto-paginating across pages.

func (*RoutingResource) ListAll added in v0.17.0

ListAll collects every routing into a slice (convenience over List).

func (*RoutingResource) Update added in v0.17.0

Update updates a routing.

type SessionsResource added in v0.17.0

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

SessionsResource is the call/automation sessions namespace (/api/v2/sessions).

func (*SessionsResource) Create added in v0.17.0

Create creates a new session.

func (*SessionsResource) Get added in v0.17.0

Get returns a session (its variables) by id.

func (*SessionsResource) UpdateVariables added in v0.17.0

UpdateVariables updates a session's variables.

type Setting added in v0.4.0

type Setting[TGet any, TUpd any] struct {
	// contains filtered or unexported fields
}

Setting is one global-settings group: read its full value with Get, replace it with Update. TGet is the returned value type; TUpd is the (partial, all-optional) update payload type.

func (Setting[TGet, TUpd]) Get added in v0.4.0

func (s Setting[TGet, TUpd]) Get(ctx context.Context) (*TGet, error)

Get reads the current value of this settings group.

func (Setting[TGet, TUpd]) Update added in v0.4.0

func (s Setting[TGet, TUpd]) Update(ctx context.Context, data TUpd) (*TGet, error)

Update replaces this settings group and returns the new value.

type SettingsResource added in v0.4.0

type SettingsResource struct {
	App       AppSettings
	Telephony TelephonySettings
	Audit     AuditSettings
	Ui        UiSettings
	Retention RetentionSettings
}

SettingsResource is the global-settings namespace (/api/v2/settings), grouped by scope.

type SmsResource added in v0.17.0

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

SmsResource is the SMS-records namespace (/api/v2/sms).

List takes the generated parameter struct directly; the Page field is managed by the auto-paginator, so leave it unset.

func (*SmsResource) Get added in v0.17.0

Get returns a single SMS record by id.

func (*SmsResource) List added in v0.17.0

List returns an iterator over SMS records, auto-paginating across pages.

func (*SmsResource) ListAll added in v0.17.0

func (r *SmsResource) ListAll(ctx context.Context, params managerapi.ListSmssParams) ([]managerapi.Sms, error)

ListAll collects every SMS record into a slice (convenience over List).

type TaskMetricsResource added in v0.17.0

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

TaskMetricsResource is the task & agent metrics namespace (/api/v3/tasks/metrics).

func (*TaskMetricsResource) AgentInteractionDurations added in v0.17.0

AgentInteractionDurations returns interaction durations for an agent.

func (*TaskMetricsResource) AgentJournal added in v0.17.0

AgentJournal returns the interaction journal for an agent.

func (*TaskMetricsResource) TaskJournal added in v0.17.0

TaskJournal returns the journal (event timeline) for a single task.

type TaskSchedulesResource added in v0.2.0

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

TaskSchedulesResource is the recurring task-schedule namespace (/api/v3/tasks/schedules).

func (*TaskSchedulesResource) Create added in v0.2.0

Create creates a task schedule.

func (*TaskSchedulesResource) Delete added in v0.2.0

func (r *TaskSchedulesResource) Delete(ctx context.Context, name string) error

Delete deletes a task schedule by name.

func (*TaskSchedulesResource) Get added in v0.2.0

Get returns a task schedule by name.

func (*TaskSchedulesResource) List added in v0.2.0

List returns all task schedules.

type TaskScriptsResource added in v0.17.0

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

TaskScriptsResource is the task-scripts namespace (/api/v3/tasks/scripts).

func (*TaskScriptsResource) Delete added in v0.17.0

func (r *TaskScriptsResource) Delete(ctx context.Context, scriptType taskautomationapi.ScriptType, codeID string) error

Delete deletes a script.

func (*TaskScriptsResource) Get added in v0.17.0

Get returns a script by type and code id.

func (*TaskScriptsResource) List added in v0.17.0

List lists scripts of a given type.

func (*TaskScriptsResource) Submit added in v0.17.0

Submit creates a script of a given type.

func (*TaskScriptsResource) Update added in v0.17.0

Update updates a script.

type TaskSecretsResource added in v0.17.0

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

TaskSecretsResource is the task-secrets namespace (/api/v3/tasks/configurations/secrets).

func (*TaskSecretsResource) Create added in v0.17.0

Create creates secrets under a prefix.

func (*TaskSecretsResource) DeleteKeys added in v0.17.0

func (r *TaskSecretsResource) DeleteKeys(ctx context.Context, prefix string, keys taskautomationapi.SecretKeys) error

DeleteKeys deletes the given secret keys under a prefix.

func (*TaskSecretsResource) ListKeys added in v0.17.0

ListKeys lists the secret keys under a prefix.

func (*TaskSecretsResource) ListPrefixes added in v0.17.0

ListPrefixes lists the secret prefixes.

func (*TaskSecretsResource) Patch added in v0.17.0

Patch merges secrets under a prefix.

type TaskSelectionConfigResource added in v0.17.0

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

TaskSelectionConfigResource is the account task-selection configuration (/api/v3/tasks/configurations/selection).

func (*TaskSelectionConfigResource) Create added in v0.17.0

Create creates the selection configuration.

func (*TaskSelectionConfigResource) Delete added in v0.17.0

Delete deletes the selection configuration.

func (*TaskSelectionConfigResource) Read added in v0.17.0

Read reads the current selection configuration.

func (*TaskSelectionConfigResource) Update added in v0.17.0

Update updates the selection configuration.

type TasksResource added in v0.2.0

type TasksResource struct {

	// Schedules is the recurring task-schedule namespace (/api/v3/tasks/schedules).
	Schedules *TaskSchedulesResource
	// Scripts is the task-scripts namespace (/api/v3/tasks/scripts).
	Scripts *TaskScriptsResource
	// Secrets is the task-secrets namespace (/api/v3/tasks/configurations/secrets).
	Secrets *TaskSecretsResource
	// SelectionConfig is the account task-selection configuration (/api/v3/tasks/configurations/selection).
	SelectionConfig *TaskSelectionConfigResource
	// Metrics is the task & agent metrics namespace (/api/v3/tasks/metrics).
	Metrics *TaskMetricsResource
	// contains filtered or unexported fields
}

TasksResource is the task-automation namespace (/api/v3/tasks).

func (*TasksResource) AgentAction added in v0.17.0

AgentAction performs an agent action on a task (accept / reject / complete).

func (*TasksResource) ChangeState deprecated added in v0.17.0

func (r *TasksResource) ChangeState(ctx context.Context, taskID string, taskState taskautomationapi.TaskState) error

ChangeState transitions a task to a new state.

Deprecated: deprecated by the API; prefer Interrupt.

func (*TasksResource) Create added in v0.2.0

Create creates a task.

func (*TasksResource) CreateFromTemplate added in v0.2.0

func (r *TasksResource) CreateFromTemplate(ctx context.Context, template string, overrides taskautomationapi.TemplateOverride) (*taskautomationapi.Task, error)

CreateFromTemplate creates a task from a template, with overrides.

func (*TasksResource) Get added in v0.2.0

Get returns a task by id.

func (*TasksResource) Interrupt added in v0.2.0

Interrupt manager-interrupts a task, transitioning it to the given target state.

func (*TasksResource) List added in v0.2.0

List returns an iterator over tasks, auto-paginating across pages.

func (*TasksResource) ListAll added in v0.2.0

ListAll collects every task into a slice.

func (*TasksResource) Logs added in v0.17.0

Logs returns the customer task logs.

func (*TasksResource) SetAgentLock added in v0.17.0

SetAgentLock changes the agent task-locking state.

func (*TasksResource) TestAction added in v0.17.0

TestAction tests a task action without dispatching it.

func (*TasksResource) Update added in v0.2.0

Update updates a task.

func (*TasksResource) Usage added in v0.17.0

Usage returns the task usage time series.

func (*TasksResource) UsageTypes added in v0.17.0

UsageTypes returns the available task usage types.

type TokenResponse

type TokenResponse struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
	TokenType   string `json:"token_type"`
}

TokenResponse is the OAuth2 token endpoint response.

func PasswordGrant

func PasswordGrant(ctx context.Context, hc *http.Client, baseURL, user, pass, clientID string) (*TokenResponse, error)

PasswordGrant exchanges a username/password for a token via {baseURL}/oauth/token. Exposed for callers who want to manage tokens themselves.

type TriggersResource added in v0.17.0

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

TriggersResource is the workflow-triggers namespace (/api/v2/triggers).

List takes the generated parameter struct directly; the Page field is managed by the auto-paginator, so leave it unset.

func (*TriggersResource) Clone added in v0.17.0

Clone clones a trigger and returns the new trigger.

func (*TriggersResource) Create added in v0.17.0

Create creates a trigger.

func (*TriggersResource) Delete added in v0.17.0

func (r *TriggersResource) Delete(ctx context.Context, id string) error

Delete deletes a trigger.

func (*TriggersResource) Get added in v0.17.0

Get returns a trigger by id.

func (*TriggersResource) List added in v0.17.0

List returns an iterator over triggers, auto-paginating across pages.

func (*TriggersResource) ListAll added in v0.17.0

ListAll collects every trigger into a slice (convenience over List).

func (*TriggersResource) Test added in v0.17.0

Test tests trigger conditions against a sample payload. testMode runs without side effects.

func (*TriggersResource) Update added in v0.17.0

Update updates a trigger.

type UiSettings added in v0.4.0

UiSettings groups the `ui` settings.

type UsersResource

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

UsersResource is the user-management namespace (/api/v2/users).

func (*UsersResource) AddRoles added in v0.17.0

func (r *UsersResource) AddRoles(ctx context.Context, emails []string, roles []managerapi.AccountRole) error

AddRoles grants the given roles to the given users (by email).

func (*UsersResource) Create

Create creates a user.

func (*UsersResource) Delete

func (r *UsersResource) Delete(ctx context.Context, emails []string) error

Delete deletes the given users (by email).

func (*UsersResource) Disable

func (r *UsersResource) Disable(ctx context.Context, emails []string) error

Disable disables the given users (by email).

func (*UsersResource) Enable

func (r *UsersResource) Enable(ctx context.Context, emails []string) error

Enable enables the given users (by email).

func (*UsersResource) List

List returns an iterator over users, auto-paginating across pages.

for user, err := range mgr.Users.List(ctx, manager.ListUsersQuery{}) {
    if err != nil { return err }
    fmt.Println(user.Email)
}

func (*UsersResource) ListAll

ListAll collects every user into a slice (convenience over List).

func (*UsersResource) ListRoles added in v0.17.0

func (r *UsersResource) ListRoles(ctx context.Context) ([]managerapi.AccountRole, error)

ListRoles lists the role names that can be assigned to users.

func (*UsersResource) RemoveRoles added in v0.17.0

func (r *UsersResource) RemoveRoles(ctx context.Context, emails []string, roles []managerapi.AccountRole) error

RemoveRoles revokes the given roles from the given users (by email).

func (*UsersResource) ResetPasswords added in v0.17.0

func (r *UsersResource) ResetPasswords(ctx context.Context, emails []string) error

ResetPasswords triggers a password-reset email for the given users (by email).

Directories

Path Synopsis
Command example lists users against a babelforce API host.
Command example lists users against a babelforce API host.
gen
manager
Package manager provides primitives to interact with the openapi HTTP API.
Package manager provides primitives to interact with the openapi HTTP API.
taskautomation
Package taskautomation provides primitives to interact with the openapi HTTP API.
Package taskautomation provides primitives to interact with the openapi HTTP API.
taskschedule
Package taskschedule provides primitives to interact with the openapi HTTP API.
Package taskschedule provides primitives to interact with the openapi HTTP API.
user
Package user provides primitives to interact with the openapi HTTP API.
Package user provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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