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{
Environment: manager.Production,
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 ¶
- type APIError
- type AgentGroupsResource
- func (r *AgentGroupsResource) AddAgent(ctx context.Context, groupID, agentID string) (*managerapi.AgentGroupAdditionResponse, error)
- func (r *AgentGroupsResource) Create(ctx context.Context, body managerapi.RestCreateAgentGroup) (*managerapi.AgentGroupItemResponse, error)
- func (r *AgentGroupsResource) Delete(ctx context.Context, id string) error
- func (r *AgentGroupsResource) Get(ctx context.Context, id string) (*managerapi.AgentGroupItemResponse, error)
- func (r *AgentGroupsResource) List(ctx context.Context, pageSize int) iter.Seq2[managerapi.AgentGroup, error]
- func (r *AgentGroupsResource) ListAll(ctx context.Context, pageSize int) ([]managerapi.AgentGroup, error)
- func (r *AgentGroupsResource) Update(ctx context.Context, id string, body managerapi.RestUpdateAgentGroup) (*managerapi.AgentGroupItemResponse, error)
- type AgentsResource
- func (r *AgentsResource) Create(ctx context.Context, body managerapi.RestCreateAgent) (*managerapi.AgentItemResponse, error)
- func (r *AgentsResource) Delete(ctx context.Context, id string) error
- func (r *AgentsResource) Get(ctx context.Context, id string) (*managerapi.AgentItemResponse, error)
- func (r *AgentsResource) List(ctx context.Context, q ListAgentsQuery) iter.Seq2[managerapi.Agent, error]
- func (r *AgentsResource) ListAll(ctx context.Context, q ListAgentsQuery) ([]managerapi.Agent, error)
- func (r *AgentsResource) Update(ctx context.Context, id string, body managerapi.RestUpdateAgent) (*managerapi.AgentItemResponse, error)
- func (r *AgentsResource) UpdateStatus(ctx context.Context, id string, status managerapi.UpdateAgentStatusRequest) (*managerapi.AgentStatus, error)
- type AppActionsResource
- func (r *AppActionsResource) Create(ctx context.Context, applicationID string, ...) (*managerapi.LocalAutomationItemResponse, error)
- func (r *AppActionsResource) Delete(ctx context.Context, applicationID, id string) error
- func (r *AppActionsResource) Get(ctx context.Context, applicationID, id string) (*managerapi.LocalAutomationItemResponse, error)
- func (r *AppActionsResource) List(ctx context.Context, applicationID string, pageSize int) iter.Seq2[managerapi.LocalAutomation, error]
- func (r *AppActionsResource) ListAll(ctx context.Context, applicationID string, pageSize int) ([]managerapi.LocalAutomation, error)
- func (r *AppActionsResource) Update(ctx context.Context, applicationID, id string, ...) (*managerapi.LocalAutomationItemResponse, error)
- type AppSettings
- type ApplicationView
- type ApplicationsResource
- func (r *ApplicationsResource) Create(ctx context.Context, body managerapi.ApplicationCreateBody) (*managerapi.ApplicationItemResponse, error)
- func (r *ApplicationsResource) Delete(ctx context.Context, id string) error
- func (r *ApplicationsResource) DeleteMany(ctx context.Context, ids []string) (*managerapi.DefaultV2MessageResponse, error)
- func (r *ApplicationsResource) Dispatch(ctx context.Context, id, position string, async bool, ...) (*managerapi.DispatchLocalAutomationsResponse, error)
- func (r *ApplicationsResource) Get(ctx context.Context, id string) (*managerapi.ApplicationItemResponse, error)
- func (r *ApplicationsResource) List(ctx context.Context, q ListApplicationsQuery) iter.Seq2[managerapi.Application, error]
- func (r *ApplicationsResource) ListAll(ctx context.Context, q ListApplicationsQuery) ([]managerapi.Application, error)
- func (r *ApplicationsResource) ListModules(ctx context.Context) (*managerapi.ListModulesResponse, error)
- func (r *ApplicationsResource) Update(ctx context.Context, id string, body managerapi.ApplicationUpdateBody) (*managerapi.ApplicationItemResponse, error)
- type AuditSettings
- type Auth
- type CallsResource
- type Environment
- type InterruptTarget
- type ListAgentsQuery
- type ListApplicationsQuery
- type ListTasksQuery
- type ListUsersQuery
- type ManagerClient
- type MetricsResource
- func (r *MetricsResource) Describe(ctx context.Context, id string) (*managerapi.MetricDefinitionItemResponse, error)
- func (r *MetricsResource) Get(ctx context.Context, id string) (*managerapi.MetricResponse, error)
- func (r *MetricsResource) ListIds(ctx context.Context) (*managerapi.MetricIdItemsResponse, error)
- func (r *MetricsResource) Push(ctx context.Context) (*managerapi.MetricRequestPushResponse, error)
- func (r *MetricsResource) Reset(ctx context.Context) (*managerapi.MetricResetCountersResponse, error)
- type Options
- type ReportingResource
- func (r *ReportingResource) List(ctx context.Context, params managerapi.ListReportingCallsParams) iter.Seq2[managerapi.Call, error]
- func (r *ReportingResource) ListAll(ctx context.Context, params managerapi.ListReportingCallsParams) ([]managerapi.Call, error)
- func (r *ReportingResource) Simple(ctx context.Context, params managerapi.ListAllSimpleReportingCallsParams) iter.Seq2[managerapi.ReportingCall, error]
- func (r *ReportingResource) SimpleAll(ctx context.Context, params managerapi.ListAllSimpleReportingCallsParams) ([]managerapi.ReportingCall, error)
- func (r *ReportingResource) SimpleAllByType(ctx context.Context, reportType managerapi.SimpleReportingReportType, ...) ([]managerapi.ReportingCall, error)
- func (r *ReportingResource) SimpleByType(ctx context.Context, reportType managerapi.SimpleReportingReportType, ...) iter.Seq2[managerapi.ReportingCall, error]
- type RetentionSettings
- type Setting
- type SettingsResource
- type TaskSchedulesResource
- func (r *TaskSchedulesResource) Create(ctx context.Context, schedule taskscheduleapi.SubmitTaskSchedule) error
- func (r *TaskSchedulesResource) Delete(ctx context.Context, name string) error
- func (r *TaskSchedulesResource) Get(ctx context.Context, name string) (*taskscheduleapi.TaskSchedule, error)
- func (r *TaskSchedulesResource) List(ctx context.Context) (*taskscheduleapi.TaskScheduleList, error)
- type TasksResource
- func (r *TasksResource) Create(ctx context.Context, task taskautomationapi.SubmitTask) (*taskautomationapi.Task, error)
- func (r *TasksResource) CreateFromTemplate(ctx context.Context, template string, ...) (*taskautomationapi.Task, error)
- func (r *TasksResource) Get(ctx context.Context, taskID string) (*taskautomationapi.Task, error)
- func (r *TasksResource) Interrupt(ctx context.Context, taskID string, target InterruptTarget, ...) error
- func (r *TasksResource) List(ctx context.Context, q ListTasksQuery) iter.Seq2[taskautomationapi.Task, error]
- func (r *TasksResource) ListAll(ctx context.Context, q ListTasksQuery) ([]taskautomationapi.Task, error)
- func (r *TasksResource) Update(ctx context.Context, taskID string, task taskautomationapi.Task) (*taskautomationapi.Task, error)
- type TelephonySettings
- type TokenResponse
- type UiSettings
- type UsersResource
- func (r *UsersResource) Create(ctx context.Context, user managerapi.CreateManagedUserRequest) (*managerapi.ManagedUserItemResponse, error)
- func (r *UsersResource) Delete(ctx context.Context, emails []string) error
- func (r *UsersResource) Disable(ctx context.Context, emails []string) error
- func (r *UsersResource) Enable(ctx context.Context, emails []string) error
- func (r *UsersResource) List(ctx context.Context, q ListUsersQuery) iter.Seq2[managerapi.ManagedUser, error]
- func (r *UsersResource) ListAll(ctx context.Context, q ListUsersQuery) ([]managerapi.ManagedUser, error)
Constants ¶
This section 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.
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
func (r *AgentGroupsResource) Create(ctx context.Context, body managerapi.RestCreateAgentGroup) (*managerapi.AgentGroupItemResponse, error)
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
func (r *AgentGroupsResource) Get(ctx context.Context, id string) (*managerapi.AgentGroupItemResponse, error)
Get returns an agent group by id.
func (*AgentGroupsResource) List ¶ added in v0.3.0
func (r *AgentGroupsResource) List(ctx context.Context, pageSize int) iter.Seq2[managerapi.AgentGroup, error]
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
func (r *AgentGroupsResource) Update(ctx context.Context, id string, body managerapi.RestUpdateAgentGroup) (*managerapi.AgentGroupItemResponse, error)
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
func (r *AgentsResource) Create(ctx context.Context, body managerapi.RestCreateAgent) (*managerapi.AgentItemResponse, error)
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
func (r *AgentsResource) Get(ctx context.Context, id string) (*managerapi.AgentItemResponse, error)
Get returns an agent by id.
func (*AgentsResource) List ¶ added in v0.3.0
func (r *AgentsResource) List(ctx context.Context, q ListAgentsQuery) iter.Seq2[managerapi.Agent, error]
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
func (r *AgentsResource) ListAll(ctx context.Context, q ListAgentsQuery) ([]managerapi.Agent, error)
ListAll collects every agent into a slice (convenience over List).
func (*AgentsResource) Update ¶ added in v0.3.0
func (r *AgentsResource) Update(ctx context.Context, id string, body managerapi.RestUpdateAgent) (*managerapi.AgentItemResponse, error)
Update updates an agent.
func (*AgentsResource) UpdateStatus ¶ added in v0.3.0
func (r *AgentsResource) UpdateStatus(ctx context.Context, id string, status managerapi.UpdateAgentStatusRequest) (*managerapi.AgentStatus, error)
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
func (r *AppActionsResource) Create(ctx context.Context, applicationID string, body managerapi.RestCreateLocalAutomation) (*managerapi.LocalAutomationItemResponse, error)
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
func (r *AppActionsResource) Get(ctx context.Context, applicationID, id string) (*managerapi.LocalAutomationItemResponse, error)
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
func (r *AppActionsResource) Update(ctx context.Context, applicationID, id string, body managerapi.RestUpdateLocalAutomation) (*managerapi.LocalAutomationItemResponse, error)
Update updates one of an application's actions.
type AppSettings ¶ added in v0.4.0
type AppSettings struct {
CustomerLogging Setting[managerapi.SettingsAppCustomerLogging, managerapi.SettingsAppCustomerLoggingRequestData]
Conversations Setting[managerapi.SettingsAppConversations, managerapi.SettingsAppConversationsRequestData]
Integrations Setting[managerapi.SettingsAppIntegrations, managerapi.SettingsAppIntegrationsRequestData]
AgentStatus Setting[managerapi.SettingsAppAgentStatus, managerapi.SettingsAppAgentStatusRequestData]
}
AppSettings groups the `app` settings.
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
func (r *ApplicationsResource) Create(ctx context.Context, body managerapi.ApplicationCreateBody) (*managerapi.ApplicationItemResponse, error)
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
func (r *ApplicationsResource) DeleteMany(ctx context.Context, ids []string) (*managerapi.DefaultV2MessageResponse, error)
DeleteMany bulk-deletes applications by id.
func (*ApplicationsResource) Dispatch ¶ added in v0.4.0
func (r *ApplicationsResource) Dispatch(ctx context.Context, id, position string, async bool, body *managerapi.LocalAutomationDispatch) (*managerapi.DispatchLocalAutomationsResponse, error)
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
func (r *ApplicationsResource) Get(ctx context.Context, id string) (*managerapi.ApplicationItemResponse, error)
Get returns an application by id.
func (*ApplicationsResource) List ¶ added in v0.4.0
func (r *ApplicationsResource) List(ctx context.Context, q ListApplicationsQuery) iter.Seq2[managerapi.Application, error]
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
func (r *ApplicationsResource) ListAll(ctx context.Context, q ListApplicationsQuery) ([]managerapi.Application, error)
ListAll collects every application into a slice (convenience over List).
func (*ApplicationsResource) ListModules ¶ added in v0.4.0
func (r *ApplicationsResource) ListModules(ctx context.Context) (*managerapi.ListModulesResponse, error)
ListModules lists the available IVR modules (the building blocks of applications).
func (*ApplicationsResource) Update ¶ added in v0.4.0
func (r *ApplicationsResource) Update(ctx context.Context, id string, body managerapi.ApplicationUpdateBody) (*managerapi.ApplicationItemResponse, error)
Update updates an application.
type AuditSettings ¶ added in v0.4.0
type AuditSettings struct {
Default Setting[managerapi.SettingsAuditDefault, managerapi.SettingsAuditDefaultRequestData]
}
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 ¶
APIKey authenticates with the X-Auth-Access-Id / X-Auth-Access-Token header pair (the primary server-to-server mode).
type CallsResource ¶ added in v0.3.0
type CallsResource struct {
// Reporting is the call-reporting sub-namespace (/api/v2/calls/reporting).
Reporting *ReportingResource
}
CallsResource is the call namespace (/api/v2/calls). Today it exposes call reporting; call control may follow.
type Environment ¶
type Environment int
Environment selects a named babelforce host. Target other (e.g. per-customer or non-production) hosts with Options.BaseURL.
const ( // Production targets https://services.babelforce.com. Production Environment = iota )
type InterruptTarget ¶ added in v0.2.0
type InterruptTarget = taskautomationapi.InterruptionTargetStates
InterruptTarget is the state a manager-interrupt transitions a task to.
const ( InterruptCancel InterruptTarget = taskautomationapi.InterruptionTargetStatesCanceled InterruptComplete InterruptTarget = taskautomationapi.InterruptionTargetStatesCompleted InterruptFail InterruptTarget = taskautomationapi.InterruptionTargetStatesFailed )
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 ManagerClient ¶
type ManagerClient struct {
// Users is the user-management namespace (/api/v2/users).
Users *UsersResource
// Agents is the agent-management namespace (/api/v2/agents).
Agents *AgentsResource
// Calls is the call namespace (/api/v2/calls), including call reporting.
Calls *CallsResource
// 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.
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
func (r *MetricsResource) Describe(ctx context.Context, id string) (*managerapi.MetricDefinitionItemResponse, error)
Describe returns a metric's definition by id.
func (*MetricsResource) Get ¶ added in v0.3.0
func (r *MetricsResource) Get(ctx context.Context, id string) (*managerapi.MetricResponse, error)
Get returns a metric's current value by id.
func (*MetricsResource) ListIds ¶ added in v0.3.0
func (r *MetricsResource) ListIds(ctx context.Context) (*managerapi.MetricIdItemsResponse, error)
ListIds lists the available metric ids.
func (*MetricsResource) Push ¶ added in v0.3.0
func (r *MetricsResource) Push(ctx context.Context) (*managerapi.MetricRequestPushResponse, error)
Push triggers a metrics push.
func (*MetricsResource) Reset ¶ added in v0.3.0
func (r *MetricsResource) Reset(ctx context.Context) (*managerapi.MetricResetCountersResponse, error)
Reset resets the metric counters.
type Options ¶
type Options struct {
// Environment selects a named host. Ignored when BaseURL is set. Defaults to Production.
Environment Environment
// BaseURL overrides the host explicitly (e.g. a per-customer URL).
BaseURL string
// Auth is how the client authenticates. Required.
Auth Auth
// HTTPClient is the underlying HTTP client. Defaults to http.DefaultClient.
HTTPClient *http.Client
}
Options configures a ManagerClient.
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
func (r *ReportingResource) List(ctx context.Context, params managerapi.ListReportingCallsParams) iter.Seq2[managerapi.Call, error]
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
func (r *ReportingResource) ListAll(ctx context.Context, params managerapi.ListReportingCallsParams) ([]managerapi.Call, error)
ListAll collects every call from the detailed report into a slice (convenience over List).
func (*ReportingResource) Simple ¶ added in v0.3.0
func (r *ReportingResource) Simple(ctx context.Context, params managerapi.ListAllSimpleReportingCallsParams) iter.Seq2[managerapi.ReportingCall, error]
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
func (r *ReportingResource) SimpleAll(ctx context.Context, params managerapi.ListAllSimpleReportingCallsParams) ([]managerapi.ReportingCall, error)
SimpleAll collects every call from the simple report into a slice (convenience over Simple).
func (*ReportingResource) SimpleAllByType ¶ added in v0.3.0
func (r *ReportingResource) SimpleAllByType(ctx context.Context, reportType managerapi.SimpleReportingReportType, params managerapi.ListSimpleReportingCallsParams) ([]managerapi.ReportingCall, error)
SimpleAllByType collects every call from a single report type into a slice.
func (*ReportingResource) SimpleByType ¶ added in v0.3.0
func (r *ReportingResource) SimpleByType(ctx context.Context, reportType managerapi.SimpleReportingReportType, params managerapi.ListSimpleReportingCallsParams) iter.Seq2[managerapi.ReportingCall, error]
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
type RetentionSettings struct {
Periods Setting[managerapi.SettingsRetentionPeriods, managerapi.SettingsRetentionPeriodsRequestData]
}
RetentionSettings groups the `retention` settings.
type Setting ¶ added in v0.4.0
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.
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 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
func (r *TaskSchedulesResource) Create(ctx context.Context, schedule taskscheduleapi.SubmitTaskSchedule) error
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
func (r *TaskSchedulesResource) Get(ctx context.Context, name string) (*taskscheduleapi.TaskSchedule, error)
Get returns a task schedule by name.
func (*TaskSchedulesResource) List ¶ added in v0.2.0
func (r *TaskSchedulesResource) List(ctx context.Context) (*taskscheduleapi.TaskScheduleList, error)
List returns all task schedules.
type TasksResource ¶ added in v0.2.0
type TasksResource struct {
// Schedules is the recurring task-schedule namespace (/api/v3/tasks/schedules).
Schedules *TaskSchedulesResource
// contains filtered or unexported fields
}
TasksResource is the task-automation namespace (/api/v3/tasks).
func (*TasksResource) Create ¶ added in v0.2.0
func (r *TasksResource) Create(ctx context.Context, task taskautomationapi.SubmitTask) (*taskautomationapi.Task, error)
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
func (r *TasksResource) Get(ctx context.Context, taskID string) (*taskautomationapi.Task, error)
Get returns a task by id.
func (*TasksResource) Interrupt ¶ added in v0.2.0
func (r *TasksResource) Interrupt(ctx context.Context, taskID string, target InterruptTarget, action taskautomationapi.ManualActionRequest) error
Interrupt manager-interrupts a task, transitioning it to the given target state.
func (*TasksResource) List ¶ added in v0.2.0
func (r *TasksResource) List(ctx context.Context, q ListTasksQuery) iter.Seq2[taskautomationapi.Task, error]
List returns an iterator over tasks, auto-paginating across pages.
func (*TasksResource) ListAll ¶ added in v0.2.0
func (r *TasksResource) ListAll(ctx context.Context, q ListTasksQuery) ([]taskautomationapi.Task, error)
ListAll collects every task into a slice.
func (*TasksResource) Update ¶ added in v0.2.0
func (r *TasksResource) Update(ctx context.Context, taskID string, task taskautomationapi.Task) (*taskautomationapi.Task, error)
Update updates a task.
type TelephonySettings ¶ added in v0.4.0
type TelephonySettings struct {
AgentInbound Setting[managerapi.SettingsTelephonyAgentInbound, managerapi.SettingsTelephonyAgentInboundRequestData]
AgentOutbound Setting[managerapi.SettingsTelephonyAgentOutbound, managerapi.SettingsTelephonyAgentOutboundRequestData]
AgentRecording Setting[managerapi.SettingsTelephonyAgentRecording, managerapi.SettingsTelephonyAgentRecordingRequestData]
AgentWrapup Setting[managerapi.SettingsTelephonyAgentWrapup, managerapi.SettingsTelephonyAgentWrapupRequestData]
PostCall Setting[managerapi.SettingsTelephonyPostCall, managerapi.SettingsTelephonyPostCallRequestData]
}
TelephonySettings groups the `telephony` settings.
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 UiSettings ¶ added in v0.4.0
type UiSettings struct {
I18n Setting[managerapi.SettingsUiI18n, managerapi.SettingsUiI18nRequestData]
}
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) Create ¶
func (r *UsersResource) Create(ctx context.Context, user managerapi.CreateManagedUserRequest) (*managerapi.ManagedUserItemResponse, error)
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 ¶
func (r *UsersResource) List(ctx context.Context, q ListUsersQuery) iter.Seq2[managerapi.ManagedUser, error]
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 ¶
func (r *UsersResource) ListAll(ctx context.Context, q ListUsersQuery) ([]managerapi.ManagedUser, error)
ListAll collects every user into a slice (convenience over List).
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Command example lists users against a babelforce environment.
|
Command example lists users against a babelforce environment. |
|
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. |