pbxv2connect

package
v1.8.29 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PBXServiceListPBXUsersProcedure is the fully-qualified name of the PBXService's ListPBXUsers RPC.
	PBXServiceListPBXUsersProcedure = "/services.pbx.v2.PBXService/ListPBXUsers"
	// PBXServiceGetPBXUserProcedure is the fully-qualified name of the PBXService's GetPBXUser RPC.
	PBXServiceGetPBXUserProcedure = "/services.pbx.v2.PBXService/GetPBXUser"
	// PBXServiceListRingGroupsProcedure is the fully-qualified name of the PBXService's ListRingGroups
	// RPC.
	PBXServiceListRingGroupsProcedure = "/services.pbx.v2.PBXService/ListRingGroups"
	// PBXServiceGetRingGroupProcedure is the fully-qualified name of the PBXService's GetRingGroup RPC.
	PBXServiceGetRingGroupProcedure = "/services.pbx.v2.PBXService/GetRingGroup"
	// PBXServiceGetSIPAccountProcedure is the fully-qualified name of the PBXService's GetSIPAccount
	// RPC.
	PBXServiceGetSIPAccountProcedure = "/services.pbx.v2.PBXService/GetSIPAccount"
	// PBXServiceGetSIPAccountByUserIdProcedure is the fully-qualified name of the PBXService's
	// GetSIPAccountByUserId RPC.
	PBXServiceGetSIPAccountByUserIdProcedure = "/services.pbx.v2.PBXService/GetSIPAccountByUserId"
	// PBXServiceListSIPAccountsProcedure is the fully-qualified name of the PBXService's
	// ListSIPAccounts RPC.
	PBXServiceListSIPAccountsProcedure = "/services.pbx.v2.PBXService/ListSIPAccounts"
	// PBXServiceUpdateSIPAccountProcedure is the fully-qualified name of the PBXService's
	// UpdateSIPAccount RPC.
	PBXServiceUpdateSIPAccountProcedure = "/services.pbx.v2.PBXService/UpdateSIPAccount"
	// PBXServiceUpdateRingGroupProcedure is the fully-qualified name of the PBXService's
	// UpdateRingGroup RPC.
	PBXServiceUpdateRingGroupProcedure = "/services.pbx.v2.PBXService/UpdateRingGroup"
	// PBXServiceCreateRingGroupProcedure is the fully-qualified name of the PBXService's
	// CreateRingGroup RPC.
	PBXServiceCreateRingGroupProcedure = "/services.pbx.v2.PBXService/CreateRingGroup"
	// PBXServiceDeleteRingGroupProcedure is the fully-qualified name of the PBXService's
	// DeleteRingGroup RPC.
	PBXServiceDeleteRingGroupProcedure = "/services.pbx.v2.PBXService/DeleteRingGroup"
	// PBXServiceAssignRandomExtensionProcedure is the fully-qualified name of the PBXService's
	// AssignRandomExtension RPC.
	PBXServiceAssignRandomExtensionProcedure = "/services.pbx.v2.PBXService/AssignRandomExtension"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// PBXServiceName is the fully-qualified name of the PBXService service.
	PBXServiceName = "services.pbx.v2.PBXService"
)

Variables

This section is empty.

Functions

func NewPBXServiceHandler

func NewPBXServiceHandler(svc PBXServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler)

NewPBXServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type PBXServiceClient

type PBXServiceClient interface {
	// Returns details of all PBX Users associated with the authenticated callers ORG
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	ListPBXUsers(context.Context, *connect_go.Request[v2.ListPBXUsersRequest]) (*connect_go.Response[v2.ListPBXUsersResponse], error)
	// Returns details of the PBX User associated with the pbx_user_id
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is invalid.
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.NotFound: The user does not exist or is not in the caller's ORG.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	GetPBXUser(context.Context, *connect_go.Request[v2.GetPBXUserRequest]) (*connect_go.Response[v2.GetPBXUserResponse], error)
	// Returns details of all Ring Groups associated with the authenticated callers ORG
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	ListRingGroups(context.Context, *connect_go.Request[v2.ListRingGroupsRequest]) (*connect_go.Response[v2.ListRingGroupsResponse], error)
	// Returns details of the Ring Group associated with the ring_group_id
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is invalid.
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.NotFound: The group does not exist or is not in the caller's ORG.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	GetRingGroup(context.Context, *connect_go.Request[v2.GetRingGroupRequest]) (*connect_go.Response[v2.GetRingGroupResponse], error)
	// Returns details of the SIP Account associated with the sip_id
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is invalid.
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.NotFound: The group does not exist or is not in the caller's ORG.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	GetSIPAccount(context.Context, *connect_go.Request[v2.GetSIPAccountRequest]) (*connect_go.Response[v2.GetSIPAccountResponse], error)
	// Returns details of the SIP Account associated with the org_user_id
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is invalid.
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.NotFound: The group does not exist or is not in the caller's ORG.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	GetSIPAccountByUserId(context.Context, *connect_go.Request[v2.GetSIPAccountByUserIdRequest]) (*connect_go.Response[v2.GetSIPAccountByUserIdResponse], error)
	// Returns details of all SIP Accounts associated with the authenticated callers ORG
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	ListSIPAccounts(context.Context, *connect_go.Request[v2.ListSIPAccountsRequest]) (*connect_go.Response[v2.ListSIPAccountsResponse], error)
	// Updates details of the SIP Account for the specific SIP Account within the authenticated callers ORG.
	// Allows for updating, activating, and deactivating a user.
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is invalid.
	//   - grpc.AlreadyExists: The extension already exists
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	UpdateSIPAccount(context.Context, *connect_go.Request[v2.UpdateSIPAccountRequest]) (*connect_go.Response[v2.UpdateSIPAccountResponse], error)
	// Updates details of a Ring Group for the authenticated callers ORG. This operation acts as an "upsert".
	//   - If the groupID is in the update mask and the group exists, the group will be updated.
	//   - If the groupID is not in the update mask a group will be created.
	//
	// Allows for creating and updating a ring group.
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is invalid.
	//   - grpc.AlreadyExists: The extension or name already exists.
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	UpdateRingGroup(context.Context, *connect_go.Request[v2.UpdateRingGroupRequest]) (*connect_go.Response[v2.UpdateRingGroupResponse], error)
	// Creates a ring group for the authenticated caller's ORG.
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is invalid.
	//   - grpc.OutOfRange: The request has fields that are out of range of constraints
	//   - grpc.AlreadyExists: The extension or name already exists.
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	CreateRingGroup(context.Context, *connect_go.Request[v2.CreateRingGroupRequest]) (*connect_go.Response[v2.CreateRingGroupResponse], error)
	// Deletes a specific Ring Group for the authenticated caller's ORG.
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.InvalidArgument: The groupID is an invalid format.
	//   - grpc.NotFound: The group does not exist or is not in the caller's ORG.
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	DeleteRingGroup(context.Context, *connect_go.Request[v2.DeleteRingGroupRequest]) (*connect_go.Response[v2.DeleteRingGroupResponse], error)
	// Assigns a random extension either to a PBX user or a Ring Group
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.NotFound: No free extension found.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	AssignRandomExtension(context.Context, *connect_go.Request[v2.AssignRandomExtensionRequest]) (*connect_go.Response[v2.AssignRandomExtensionResponse], error)
}

PBXServiceClient is a client for the services.pbx.v2.PBXService service.

func NewPBXServiceClient

func NewPBXServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) PBXServiceClient

NewPBXServiceClient constructs a client for the services.pbx.v2.PBXService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type PBXServiceHandler

type PBXServiceHandler interface {
	// Returns details of all PBX Users associated with the authenticated callers ORG
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	ListPBXUsers(context.Context, *connect_go.Request[v2.ListPBXUsersRequest]) (*connect_go.Response[v2.ListPBXUsersResponse], error)
	// Returns details of the PBX User associated with the pbx_user_id
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is invalid.
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.NotFound: The user does not exist or is not in the caller's ORG.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	GetPBXUser(context.Context, *connect_go.Request[v2.GetPBXUserRequest]) (*connect_go.Response[v2.GetPBXUserResponse], error)
	// Returns details of all Ring Groups associated with the authenticated callers ORG
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	ListRingGroups(context.Context, *connect_go.Request[v2.ListRingGroupsRequest]) (*connect_go.Response[v2.ListRingGroupsResponse], error)
	// Returns details of the Ring Group associated with the ring_group_id
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is invalid.
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.NotFound: The group does not exist or is not in the caller's ORG.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	GetRingGroup(context.Context, *connect_go.Request[v2.GetRingGroupRequest]) (*connect_go.Response[v2.GetRingGroupResponse], error)
	// Returns details of the SIP Account associated with the sip_id
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is invalid.
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.NotFound: The group does not exist or is not in the caller's ORG.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	GetSIPAccount(context.Context, *connect_go.Request[v2.GetSIPAccountRequest]) (*connect_go.Response[v2.GetSIPAccountResponse], error)
	// Returns details of the SIP Account associated with the org_user_id
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is invalid.
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.NotFound: The group does not exist or is not in the caller's ORG.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	GetSIPAccountByUserId(context.Context, *connect_go.Request[v2.GetSIPAccountByUserIdRequest]) (*connect_go.Response[v2.GetSIPAccountByUserIdResponse], error)
	// Returns details of all SIP Accounts associated with the authenticated callers ORG
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	ListSIPAccounts(context.Context, *connect_go.Request[v2.ListSIPAccountsRequest]) (*connect_go.Response[v2.ListSIPAccountsResponse], error)
	// Updates details of the SIP Account for the specific SIP Account within the authenticated callers ORG.
	// Allows for updating, activating, and deactivating a user.
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is invalid.
	//   - grpc.AlreadyExists: The extension already exists
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	UpdateSIPAccount(context.Context, *connect_go.Request[v2.UpdateSIPAccountRequest]) (*connect_go.Response[v2.UpdateSIPAccountResponse], error)
	// Updates details of a Ring Group for the authenticated callers ORG. This operation acts as an "upsert".
	//   - If the groupID is in the update mask and the group exists, the group will be updated.
	//   - If the groupID is not in the update mask a group will be created.
	//
	// Allows for creating and updating a ring group.
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is invalid.
	//   - grpc.AlreadyExists: The extension or name already exists.
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	UpdateRingGroup(context.Context, *connect_go.Request[v2.UpdateRingGroupRequest]) (*connect_go.Response[v2.UpdateRingGroupResponse], error)
	// Creates a ring group for the authenticated caller's ORG.
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.InvalidArgument: The request is invalid.
	//   - grpc.OutOfRange: The request has fields that are out of range of constraints
	//   - grpc.AlreadyExists: The extension or name already exists.
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	CreateRingGroup(context.Context, *connect_go.Request[v2.CreateRingGroupRequest]) (*connect_go.Response[v2.CreateRingGroupResponse], error)
	// Deletes a specific Ring Group for the authenticated caller's ORG.
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.InvalidArgument: The groupID is an invalid format.
	//   - grpc.NotFound: The group does not exist or is not in the caller's ORG.
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	DeleteRingGroup(context.Context, *connect_go.Request[v2.DeleteRingGroupRequest]) (*connect_go.Response[v2.DeleteRingGroupResponse], error)
	// Assigns a random extension either to a PBX user or a Ring Group
	// Required permissions:
	//
	//	PBX-MANAGER
	//
	// Errors:
	//   - grpc.PermissionDenied: Caller doesn't have the required permissions.
	//   - grpc.NotFound: No free extension found.
	//   - grpc.Internal: An internal error occurred.
	//   - grpc.Unavailable: The operation is currently unavailable. Likely a transient issue with a downstream service.
	AssignRandomExtension(context.Context, *connect_go.Request[v2.AssignRandomExtensionRequest]) (*connect_go.Response[v2.AssignRandomExtensionResponse], error)
}

PBXServiceHandler is an implementation of the services.pbx.v2.PBXService service.

type UnimplementedPBXServiceHandler

type UnimplementedPBXServiceHandler struct{}

UnimplementedPBXServiceHandler returns CodeUnimplemented from all methods.

Jump to

Keyboard shortcuts

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