Documentation
¶
Index ¶
- type AddMessagingGroupMemberEndpoint
- type AddMessagingGroupMemberRequest
- type CreateMessagingGroupEndpoint
- type CreateMessagingGroupRequest
- type DeleteMessagingGroupEndpoint
- type DeleteMessagingGroupRequest
- type GetMessagingGroupEndpoint
- type GetMessagingGroupRequest
- type ListMessagingGroupsEndpoint
- type ListMessagingGroupsRequest
- type MessagingGroupSvc
- type MessagingGroupSvcConfig
- type RemoveMessagingGroupMemberEndpoint
- type RemoveMessagingGroupMemberRequest
- type UpdateMessagingGroupEndpoint
- type UpdateMessagingGroupRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddMessagingGroupMemberEndpoint ¶
type AddMessagingGroupMemberEndpoint struct{}
Adds a member (a user or an agent) to a reusable roster and returns the updated roster.
Adding someone who is already on the roster does not create a second entry for them. The new member is picked up only by conversations started from the roster afterwards; conversations already created from it keep the members they were seeded with.
func (*AddMessagingGroupMemberEndpoint) Materialize ¶
func (e *AddMessagingGroupMemberEndpoint) Materialize() *apiendpoint.APIEndpoint[*AddMessagingGroupMemberRequest, *apiresource.MessagingGroup]
type AddMessagingGroupMemberRequest ¶
type AddMessagingGroupMemberRequest struct {
// Messaging group ID.
GroupID string `path:"id" validate:"required"`
// The kind of member being added, which decides whether `account_user_id` or `agent_config_id` is expected.
MemberType constants.MessagingGroupMemberType `json:"member_type" validate:"required"`
// The account user to add (required when `member_type` is `user`).
AccountUserID field.Optional[string] `json:"account_user_id,omitzero"`
// The agent to add (required when `member_type` is `agent`).
AgentConfigID field.Optional[string] `json:"agent_config_id,omitzero"`
}
Request to add a member to a reusable roster.
func (*AddMessagingGroupMemberRequest) SchemaExample ¶
func (*AddMessagingGroupMemberRequest) SchemaExample() any
type CreateMessagingGroupEndpoint ¶
type CreateMessagingGroupEndpoint struct{}
Creates a reusable roster of members (users and/or agents) that can seed many conversations.
Every account user listed must exist; repeated ids are ignored. The caller is recorded as the creator but is not added to the roster automatically — include their own account user id to be a member.
func (*CreateMessagingGroupEndpoint) Materialize ¶
func (e *CreateMessagingGroupEndpoint) Materialize() *apiendpoint.APIEndpoint[*CreateMessagingGroupRequest, *apiresource.MessagingGroup]
type CreateMessagingGroupRequest ¶
type CreateMessagingGroupRequest struct {
// The roster's display name.
Name string `json:"name" validate:"required"`
// The account users to include in the roster.
MemberAccountUserIDs []string `json:"member_account_user_ids,omitzero"`
// The agents to include in the roster.
MemberAgentConfigIDs []string `json:"member_agent_config_ids,omitzero"`
}
Request to create a reusable roster.
func (*CreateMessagingGroupRequest) SchemaExample ¶
func (*CreateMessagingGroupRequest) SchemaExample() any
type DeleteMessagingGroupEndpoint ¶
type DeleteMessagingGroupEndpoint struct{}
Deletes a reusable roster.
Conversations already started from it are unaffected (their members were snapshotted); they simply lose the roster reference.
func (*DeleteMessagingGroupEndpoint) Materialize ¶
func (e *DeleteMessagingGroupEndpoint) Materialize() *apiendpoint.APIEndpoint[*DeleteMessagingGroupRequest, *apiresource.EmptyResource]
type DeleteMessagingGroupRequest ¶
type DeleteMessagingGroupRequest struct {
// Messaging group ID.
GroupID string `path:"id" validate:"required"`
}
Request to delete a reusable roster.
type GetMessagingGroupEndpoint ¶
type GetMessagingGroupEndpoint struct{}
Retrieves a reusable roster together with its current members.
func (*GetMessagingGroupEndpoint) Materialize ¶
func (e *GetMessagingGroupEndpoint) Materialize() *apiendpoint.APIEndpoint[*GetMessagingGroupRequest, *apiresource.MessagingGroup]
type GetMessagingGroupRequest ¶
type GetMessagingGroupRequest struct {
// Messaging group ID.
GroupID string `path:"id" validate:"required"`
}
Request to retrieve one reusable roster.
type ListMessagingGroupsEndpoint ¶
type ListMessagingGroupsEndpoint struct{}
Lists the reusable rosters in the caller's account, each with its members.
Rosters come back most-recently-updated first, and adding or removing a member counts as an update. The whole account's rosters are returned in one page.
func (*ListMessagingGroupsEndpoint) Materialize ¶
func (e *ListMessagingGroupsEndpoint) Materialize() *apiendpoint.APIEndpoint[*ListMessagingGroupsRequest, *apiresource.List[apiresource.MessagingGroup]]
type ListMessagingGroupsRequest ¶
type ListMessagingGroupsRequest struct{}
Request to list the account's reusable rosters.
type MessagingGroupSvc ¶
type MessagingGroupSvc interface {
CreateMessagingGroup(ctx context.Context, req *CreateMessagingGroupRequest) (*apiresource.MessagingGroup, *apierror.APIError)
ListMessagingGroups(ctx context.Context, req *ListMessagingGroupsRequest) (*apiresource.List[apiresource.MessagingGroup], *apierror.APIError)
GetMessagingGroup(ctx context.Context, req *GetMessagingGroupRequest) (*apiresource.MessagingGroup, *apierror.APIError)
UpdateMessagingGroup(ctx context.Context, req *UpdateMessagingGroupRequest) (*apiresource.MessagingGroup, *apierror.APIError)
DeleteMessagingGroup(ctx context.Context, req *DeleteMessagingGroupRequest) (*apiresource.EmptyResource, *apierror.APIError)
AddMessagingGroupMember(ctx context.Context, req *AddMessagingGroupMemberRequest) (*apiresource.MessagingGroup, *apierror.APIError)
RemoveMessagingGroupMember(ctx context.Context, req *RemoveMessagingGroupMemberRequest) (*apiresource.MessagingGroup, *apierror.APIError)
}
MessagingGroupSvc backs the reusable-roster endpoints via the notification-service ChatService gRPC client.
func NewMessagingGroupSvc ¶
func NewMessagingGroupSvc(config *MessagingGroupSvcConfig) MessagingGroupSvc
type MessagingGroupSvcConfig ¶
type MessagingGroupSvcConfig struct {
// ChatClient (required) is the notification-service ChatService gRPC client.
ChatClient pb.ChatServiceClient
}
type RemoveMessagingGroupMemberEndpoint ¶
type RemoveMessagingGroupMemberEndpoint struct{}
Removes a member from a reusable roster and returns the updated roster.
Only conversations started from the roster afterwards are affected; the member stays in every conversation that was already seeded from it.
func (*RemoveMessagingGroupMemberEndpoint) Materialize ¶
func (e *RemoveMessagingGroupMemberEndpoint) Materialize() *apiendpoint.APIEndpoint[*RemoveMessagingGroupMemberRequest, *apiresource.MessagingGroup]
type RemoveMessagingGroupMemberRequest ¶
type RemoveMessagingGroupMemberRequest struct {
// Messaging group ID.
GroupID string `path:"id" validate:"required"`
// The membership ID to remove (from the roster's `members`).
MemberID string `path:"member_id" validate:"required"`
}
Request to remove a member from a reusable roster.
type UpdateMessagingGroupEndpoint ¶
type UpdateMessagingGroupEndpoint struct{}
Renames a reusable roster.
Members are managed through the add-member and remove-member endpoints, not here.
func (*UpdateMessagingGroupEndpoint) Materialize ¶
func (e *UpdateMessagingGroupEndpoint) Materialize() *apiendpoint.APIEndpoint[*UpdateMessagingGroupRequest, *apiresource.MessagingGroup]
type UpdateMessagingGroupRequest ¶
type UpdateMessagingGroupRequest struct {
// Messaging group ID.
GroupID string `path:"id" validate:"required"`
// The roster's new display name.
Name string `json:"name" validate:"required"`
}
Request to rename a reusable roster.
func (*UpdateMessagingGroupRequest) SchemaExample ¶
func (*UpdateMessagingGroupRequest) SchemaExample() any