webexsdk

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseResponse

func ParseResponse(resp *http.Response, v interface{}) error

ParseResponse parses an HTTP response into the given interface

Types

type Client

type Client struct {
	// HTTP client used to communicate with the API
	HttpClient *http.Client

	// Base URL for API requests
	BaseURL *url.URL

	// Access token for API authentication
	AccessToken string

	// Configuration for the client
	Config *Config
	// contains filtered or unexported fields
}

Client is the main Webex client struct

func NewClient

func NewClient(accessToken string, config *Config) (*Client, error)

NewClient creates a new Webex client with the given access token and optional configuration

func (*Client) GetPlugin

func (c *Client) GetPlugin(name string) (Plugin, bool)

GetPlugin returns a plugin by name

func (*Client) RegisterPlugin

func (c *Client) RegisterPlugin(plugin Plugin)

RegisterPlugin registers a plugin with the client

func (*Client) Request

func (c *Client) Request(method, path string, params url.Values, body interface{}) (*http.Response, error)

Request performs an HTTP request to the Webex API

type Config

type Config struct {
	// BaseURL is the base URL of the Webex API
	BaseURL string

	// Timeout for API requests
	Timeout time.Duration

	// Default headers to include in API requests
	DefaultHeaders map[string]string

	// Custom HTTP client to use instead of the default one
	// If nil, a default client will be created with the specified Timeout
	HttpClient *http.Client
}

Config holds the configuration for the Webex client

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a default configuration for the Webex client

type Page

type Page struct {
	Items    []json.RawMessage `json:"items"`
	NextPage string            `json:"nextPage,omitempty"`
	PrevPage string            `json:"prevPage,omitempty"`
	HasNext  bool              `json:"-"`
	HasPrev  bool              `json:"-"`
	Client   *Client           `json:"-"`
	Resource string            `json:"-"`
}

Page represents a paginated response from the Webex API

func NewPage

func NewPage(resp *http.Response, client *Client, resource string) (*Page, error)

NewPage creates a new Page from an HTTP response

func (*Page) Next

func (p *Page) Next() (*Page, error)

Next retrieves the next page of results

func (*Page) Prev

func (p *Page) Prev() (*Page, error)

Prev retrieves the previous page of results

type Plugin

type Plugin interface {
	// Name returns the name of the plugin
	Name() string
}

Plugin represents a Webex API plugin

Jump to

Keyboard shortcuts

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