zoom

package
v1.8.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WebhookStatusStarted         = "STARTED"
	WebhookStatusEnded           = "ENDED"
	RecordingWebhookTypeComplete = "RECORDING_MEETING_COMPLETED"
	RecentlyCreated              = "RECENTLY_CREATED"

	EventTypeMeetingStarted  EventType = "meeting.started"
	EventTypeMeetingEnded    EventType = "meeting.ended"
	EventTypeValidateWebhook EventType = "endpoint.url_validation"
)
View Source
const (

	// OAuthPrompt stores the template to show the users to connect to Zoom
	OAuthPrompt = "[Click here to link your Zoom account.](%s/plugins/zoom/oauth2/connect)"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthError added in v1.5.0

type AuthError struct {
	Message string `json:"message"`
	Err     error  `json:"err"`
}

AuthError represents a Zoom authentication error

func (*AuthError) Error added in v1.5.0

func (err *AuthError) Error() string

type Client

type Client interface {
	GetMeeting(meetingID int) (*Meeting, error)
	GetUser(user *model.User, firstConnect bool) (*User, *AuthError)
	CreateMeeting(user *User, topic string) (*Meeting, error)
}

Client interface for Zoom

func NewOAuthClient added in v1.5.0

func NewOAuthClient(token *oauth2.Token, config *oauth2.Config, siteURL, apiURL string, isAccountLevel bool, api PluginAPI) Client

NewOAuthClient creates a new Zoom OAuthClient instance.

type ComplianceRequest added in v1.5.0

type ComplianceRequest struct {
	ClientID                     string                 `json:"client_id"`
	UserID                       string                 `json:"user_id"`
	AccountID                    string                 `json:"account_id"`
	DeauthorizationEventReceived DeauthorizationPayload `json:"deauthorization_event_received"`
	ComplianceCompleted          bool                   `json:"compliance_completed"`
}

type CreateMeetingRequest added in v1.7.0

type CreateMeetingRequest struct {
	Topic          string      `json:"topic"`
	Type           MeetingType `json:"type"`
	StartTime      string      `json:"start_time,omitempty"`
	Duration       int         `json:"duration,omitempty"`
	ScheduleFor    string      `json:"schedule_for,omitempty"`
	Timezone       string      `json:"timezone,omitempty"`
	Password       string      `json:"password"`
	Agenda         string      `json:"agenda"`
	TrackingFields []struct {
		Field string `json:"field"`
		Value string `json:"value"`
	} `json:"tracking_fields"`
	Recurrence *struct {
		Type           int    `json:"type"`
		RepeatInterval int    `json:"repeat_interval"`
		WeeklyDays     string `json:"weekly_days,omitempty"`
		MonthlyDay     int    `json:"monthly_day,omitempty"`
		MonthlyWeekDay int    `json:"monthly_week_day,omitempty"`
		EndTimes       int    `json:"end_times,omitempty"`
		EndDateTime    int    `json:"end_date_time,omitempty"`
	} `json:"recurrence,omitempty"`
	Settings struct {
		HostVideo             bool     `json:"host_video"`
		ParticipantVideo      bool     `json:"participant_video"`
		CNMeeting             bool     `json:"cn_meeting"`
		INMeeting             bool     `json:"in_meeting"`
		JoinBeforeHost        bool     `json:"join_before_host"`
		MuteUponEntry         bool     `json:"mute_upon_entry"`
		Watermark             bool     `json:"watermark"`
		UsePMI                bool     `json:"use_pmi"`
		ApprovalType          int      `json:"approval_type"`
		RegistrationType      int      `json:"registration_type"`
		Audio                 string   `json:"audio"`
		AutoRecording         string   `json:"auto_recording"`
		AlternativeHosts      string   `json:"alternative_hosts"`
		WaitingRoom           bool     `json:"waiting_room"`
		GlobalDialInCountries []string `json:"global_dial_in_countries"`
		GlobalDialInNumbers   []struct {
			Country     string `json:"country"`
			CountryName string `json:"country_name"`
			City        string `json:"city"`
			Number      string `json:"number"`
			Type        string `json:"type"`
		} `json:"global_dial_in_numbers"`
		ContactName                  string `json:"contact_name"`
		ContactEmail                 string `json:"contact_email"`
		RegistrantsConfirmationEmail bool   `json:"registrants_confirmation_email"`
		RegistrantsEmailNotification bool   `json:"registrants_email_notification"`
		MeetingAuthentication        bool   `json:"meeting_authentication"`
		AuthenticationOption         string `json:"authentication_option"`
		AuthenticationDomains        string `json:"authentication_domains"`
		AuthenticationName           string `json:"authentication_name"`
	} `json:"settings,omitempty"`
}

CreateMeetingRequest as defined at https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingcreate

type DeauthorizationEvent added in v1.4.0

type DeauthorizationEvent struct {
	Event   string
	Payload DeauthorizationPayload
}

type DeauthorizationPayload added in v1.4.0

type DeauthorizationPayload struct {
	UserDataRetention   string `json:"user_data_retention"`
	AccountID           string `json:"account_id"`
	UserID              string `json:"user_id"`
	Signature           string
	DeauthorizationTime time.Time `json:"deauthorization_time"`
	ClientID            string    `json:"client_id"`
}

type EventType added in v1.4.0

type EventType string

type Meeting

type Meeting struct {
	UUID              string      `json:"uuid"`
	ID                int         `json:"id"`
	HostID            string      `json:"host_id"`
	Topic             string      `json:"topic"`
	Type              MeetingType `json:"type"`
	Status            string      `json:"status"`
	StartTime         string      `json:"start_time"`
	Duration          int         `json:"duration"`
	Timezone          string      `json:"timezone"`
	CreatedAt         string      `json:"created_at"`
	Agenda            string      `json:"agenda"`
	JoinURL           string      `json:"join_url"`
	StartURL          string      `json:"start_url"`
	Password          string      `json:"password"`
	H323Password      string      `json:"h323_password"`
	EncryptedPassword string      `json:"encrypted_password"`
	PMI               int         `json:"pmi"`
	TrackingFields    []struct {
		Field string `json:"field"`
		Value string `json:"value"`
	} `json:"tracking_fields"`
	Occurrences []struct {
		OccurrenceID string `json:"occurrence_id"`
		StartTime    string `json:"start_time"`
		Duration     int    `json:"duration"`
		Status       string `json:"status"`
	} `json:"occurrences"`
	Settings struct {
		HostVideo             bool     `json:"host_video"`
		ParticipantVideo      bool     `json:"participant_video"`
		CNMeeting             bool     `json:"cn_meeting"`
		INMeeting             bool     `json:"in_meeting"`
		JoinBeforeHost        bool     `json:"join_before_host"`
		MuteUponEntry         bool     `json:"mute_upon_entry"`
		Watermark             bool     `json:"watermark"`
		UsePMI                bool     `json:"use_pmi"`
		ApprovalType          int      `json:"approval_type"`
		RegistrationType      int      `json:"registration_type"`
		Audio                 string   `json:"audio"`
		AutoRecording         string   `json:"auto_recording"`
		AlternativeHosts      string   `json:"alternative_hosts"`
		WaitingRoom           bool     `json:"waiting_room"`
		GlobalDialInCountries []string `json:"global_dial_in_countries"`
		GlobalDialInNumbers   []struct {
			Country     string `json:"country"`
			CountryName string `json:"country_name"`
			City        string `json:"city"`
			Number      string `json:"number"`
			Type        string `json:"type"`
		} `json:"global_dial_in_numbers"`
		ContactName                  string `json:"contact_name"`
		ContactEmail                 string `json:"contact_email"`
		RegistrantsConfirmationEmail bool   `json:"registrants_confirmation_email"`
		RegistrantsEmailNotification bool   `json:"registrants_email_notification"`
		MeetingAuthentication        bool   `json:"meeting_authentication"`
		AuthenticationOption         string `json:"authentication_option"`
		AuthenticationDomains        string `json:"authentication_domains"`
		AuthenticationName           string `json:"authentication_name"`
	} `json:"settings"`
}

Meeting is defined at https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meeting

type MeetingType added in v1.7.0

type MeetingType int

MeetingType as defined at https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingcreate

const (
	// MeetingTypeInstant meeting
	MeetingTypeInstant MeetingType = 1
	// MeetingTypeScheduled meeting
	MeetingTypeScheduled MeetingType = 2
	// MeetingTypeRecurringWithNoFixedTime meeting
	MeetingTypeRecurringWithNoFixedTime MeetingType = 3
	// MeetingTypeRecurringWithFixedTime meeting
	MeetingTypeRecurringWithFixedTime MeetingType = 8
)

type MeetingWebhook added in v1.4.0

type MeetingWebhook struct {
	Event   EventType             `json:"event"`
	Payload MeetingWebhookPayload `json:"payload"`
}

type MeetingWebhookObject added in v1.4.0

type MeetingWebhookObject struct {
	Duration  int       `json:"duration"`
	StartTime time.Time `json:"start_time"`
	Timezone  string    `json:"timezone"`
	EndTime   time.Time `json:"end_time"`
	Topic     string    `json:"topic"`
	ID        string    `json:"id"`
	Type      int       `json:"type"`
	UUID      string    `json:"uuid"`
	HostID    string    `json:"host_id"`
}

type MeetingWebhookPayload added in v1.4.0

type MeetingWebhookPayload struct {
	AccountID string               `json:"account_id"`
	Object    MeetingWebhookObject `json:"object"`
}

type OAuthClient added in v1.5.0

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

OAuthClient represents an OAuth-based Zoom client.

func (*OAuthClient) CreateMeeting added in v1.7.0

func (c *OAuthClient) CreateMeeting(user *User, topic string) (*Meeting, error)

CreateMeeting creates a new meeting for the user and returns the created meeting.

func (*OAuthClient) GetMeeting added in v1.5.0

func (c *OAuthClient) GetMeeting(meetingID int) (*Meeting, error)

GetMeeting returns the Zoom meeting with the given ID via OAuth.

func (*OAuthClient) GetUser added in v1.5.0

func (c *OAuthClient) GetUser(user *model.User, firstConnect bool) (*User, *AuthError)

GetUser returns the Zoom user via OAuth.

type OAuthUserInfo added in v1.5.0

type OAuthUserInfo struct {
	ZoomEmail  string
	OAuthToken *oauth2.Token // Zoom OAuth Token, ttl 15 years
	UserID     string        // Mattermost userID
	ZoomID     string        // Zoom userID
}

OAuthUserInfo represents a Zoom user authenticated via OAuth.

type PluginAPI added in v1.5.1

type PluginAPI interface {
	GetZoomSuperUserToken() (*oauth2.Token, error)
	SetZoomSuperUserToken(*oauth2.Token) error
	GetZoomOAuthUserInfo(userID string) (*OAuthUserInfo, error)
	UpdateZoomOAuthUserInfo(userID string, info *OAuthUserInfo) error
}

type RecordingWebhook

type RecordingWebhook struct {
	Type    string `schema:"type"`
	Content string `schema:"content"`
}

type RecordingWebhookContent

type RecordingWebhookContent struct {
	UUID           string    `json:"uuid"`
	MeetingNumber  int       `json:"meeting_number"`
	AccountID      string    `json:"account_id"`
	HostID         string    `json:"host_id"`
	Topic          string    `json:"topic"`
	StartTime      time.Time `json:"start_time"`
	Timezone       string    `json:"timezone"`
	HostEmail      string    `json:"host_email"`
	Duration       int       `json:"duration"`
	TotalSize      int       `json:"total_size"`
	RecordingCount int       `json:"recording_count"`
	RecordingFiles []struct {
		ID             string    `json:"id"`
		MeetingID      string    `json:"meeting_id"`
		RecordingStart time.Time `json:"recording_start"`
		RecordingEnd   time.Time `json:"recording_end"`
		FileType       string    `json:"file_type"`
		FileSize       int       `json:"file_size"`
		FilePath       string    `json:"file_path"`
		Status         string    `json:"status"`
	} `json:"recording_files"`
}

type User

type User struct {
	ID                string    `json:"id"`
	FirstName         string    `json:"first_name"`
	LastName          string    `json:"last_name"`
	Email             string    `json:"email"`
	Type              int       `json:"type"`
	Pmi               int       `json:"pmi"`
	Timezone          string    `json:"timezone"`
	Dept              string    `json:"dept"`
	CreatedAt         time.Time `json:"created_at"`
	LastLoginTime     time.Time `json:"last_login_time"`
	LastClientVersion string    `json:"last_client_version"`
	VanityURL         string    `json:"vanity_url"`
	Verified          int       `json:"verified"`
	PicURL            string    `json:"pic_url"`
}

User is defined at https://marketplace.zoom.us/docs/api-reference/zoom-api/users/users

type ValidationWebhook added in v1.6.2

type ValidationWebhook struct {
	Event   EventType                `json:"event"`
	Payload ValidationWebhookPayload `json:"payload"`
}

type ValidationWebhookPayload added in v1.6.2

type ValidationWebhookPayload struct {
	PlainToken string `json:"plainToken"`
}

type ValidationWebhookResponse added in v1.6.2

type ValidationWebhookResponse struct {
	PlainToken     string `json:"plainToken"`
	EncryptedToken string `json:"encryptedToken"`
}

type Webhook

type Webhook struct {
	Event     EventType   `json:"event"`
	EventTime int         `json:"event_ts"`
	Payload   interface{} `json:"payload"`
}

Jump to

Keyboard shortcuts

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