people

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBase64

func DecodeBase64(s string) (string, error)

DecodeBase64 decodes a base64 string

func EncodeBase64

func EncodeBase64(s string) string

EncodeBase64 encodes a string to base64

func InferPersonIDFromUUID

func InferPersonIDFromUUID(id string) string

InferPersonIDFromUUID converts a UUID to a Hydra ID without a network call

Types

type BatchResponse

type BatchResponse struct {
	Items       []Person `json:"items"`
	NotFoundIDs []string `json:"notFoundIds,omitempty"`
}

BatchResponse represents the response from a batch people request

type Batcher

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

Batcher manages batched requests for people

func NewBatcher

func NewBatcher(client *webexsdk.Client, config *Config) *Batcher

NewBatcher creates a new people batcher

func (*Batcher) BatchRequest

func (b *Batcher) BatchRequest(ids []string) ([]Person, error)

BatchRequest processes a batch of requests immediately

func (*Batcher) Request

func (b *Batcher) Request(id string) (*Person, error)

Request adds a request to the batch and returns the result

type Client

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

Client is the people API client

func New

func New(webexClient *webexsdk.Client, config *Config) *Client

New creates a new People plugin

func (*Client) Get

func (c *Client) Get(personID string) (*Person, error)

Get returns a single person by ID

func (*Client) GetMe

func (c *Client) GetMe() (*Person, error)

GetMe returns the current authenticated user

func (*Client) List

func (c *Client) List(options *ListOptions) (*PeoplePage, error)

List returns a list of people

type Config

type Config struct {
	// BatcherWait is the time to wait before processing a batch request
	BatcherWait time.Duration

	// MaxBatchCalls is the maximum number of batch calls to make at once
	MaxBatchCalls int

	// MaxBatchWait is the maximum time to wait before processing a batch request
	MaxBatchWait time.Duration

	// ShowAllTypes is a flag that requires the API to send every type field,
	// even if the type is not "person" (e.g.: SX10, webhook_integration, etc.)
	ShowAllTypes bool
}

Config holds the configuration for the People plugin

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default configuration for the People plugin

type ListOptions

type ListOptions struct {
	Email        string   `url:"email,omitempty"`
	DisplayName  string   `url:"displayName,omitempty"`
	IDs          []string `url:"-"` // Handled separately in the List method
	Max          int      `url:"max,omitempty"`
	ShowAllTypes bool     `url:"showAllTypes,omitempty"`
}

ListOptions contains the options for listing people

type PeoplePage

type PeoplePage struct {
	Items []Person `json:"items"`
	*webexsdk.Page
}

PeoplePage represents a paginated list of people

type Person

type Person struct {
	ID          string    `json:"id"`
	Emails      []string  `json:"emails"`
	DisplayName string    `json:"displayName"`
	NickName    string    `json:"nickName,omitempty"`
	FirstName   string    `json:"firstName,omitempty"`
	LastName    string    `json:"lastName,omitempty"`
	Avatar      string    `json:"avatar,omitempty"`
	OrgID       string    `json:"orgId,omitempty"`
	Roles       []string  `json:"roles,omitempty"`
	Licenses    []string  `json:"licenses,omitempty"`
	Created     time.Time `json:"created,omitempty"`
	Status      string    `json:"status,omitempty"`
	Type        string    `json:"type,omitempty"`
}

Person represents a Webex person

Jump to

Keyboard shortcuts

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