users

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package users provides a client for Snyk v1 Users API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client provides access to v1 Users API endpoints.

func New

func New(baseClient *client.Client) *Client

New creates a new v1 Users client.

func (*Client) Get

func (c *Client) Get(ctx context.Context, userID string) (*User, error)

Get retrieves a user by ID. GET /user/{userId}

func (*Client) GetMe

func (c *Client) GetMe(ctx context.Context) (*User, error)

GetMe retrieves the current user's details. GET /user/me

func (*Client) GetOrgNotificationSettings

func (c *Client) GetOrgNotificationSettings(ctx context.Context, orgID string) (*NotificationSettings, error)

GetOrgNotificationSettings retrieves notification settings for an org. GET /user/me/notification-settings/org/{orgId}

func (*Client) GetProjectNotificationSettings

func (c *Client) GetProjectNotificationSettings(ctx context.Context, orgID, projectID string) (*NotificationSettings, error)

GetProjectNotificationSettings retrieves notification settings for a project. GET /user/me/notification-settings/org/{orgId}/project/{projectId}

func (*Client) UpdateOrgNotificationSettings

func (c *Client) UpdateOrgNotificationSettings(ctx context.Context, orgID string, settings *NotificationSettings) (*NotificationSettings, error)

UpdateOrgNotificationSettings updates notification settings for an org. PUT /user/me/notification-settings/org/{orgId}

func (*Client) UpdateProjectNotificationSettings

func (c *Client) UpdateProjectNotificationSettings(ctx context.Context, orgID, projectID string, settings *NotificationSettings) (*NotificationSettings, error)

UpdateProjectNotificationSettings updates notification settings for a project. PUT /user/me/notification-settings/org/{orgId}/project/{projectId}

type Group

type Group struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Group represents a group the org belongs to.

type NotificationSetting

type NotificationSetting struct {
	Enabled       bool   `json:"enabled"`
	IssueSeverity string `json:"issueSeverity,omitempty"`
	IssueType     string `json:"issueType,omitempty"`
	Inherited     bool   `json:"inherited,omitempty"`
}

NotificationSetting represents a single notification setting.

type NotificationSettings

type NotificationSettings struct {
	NewIssuesRemediations *NotificationSetting `json:"new-issues-remediations,omitempty"`
	ProjectImported       *NotificationSetting `json:"project-imported,omitempty"`
	TestLimit             *NotificationSetting `json:"test-limit,omitempty"`
	WeeklyReport          *NotificationSetting `json:"weekly-report,omitempty"`
}

NotificationSettings represents notification settings.

type User

type User struct {
	ID       string    `json:"id"`
	Name     string    `json:"name"`
	Username string    `json:"username"`
	Email    string    `json:"email"`
	Orgs     []UserOrg `json:"orgs,omitempty"`
}

User represents a Snyk user.

type UserOrg

type UserOrg struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Slug  string `json:"slug,omitempty"`
	URL   string `json:"url,omitempty"`
	Group *Group `json:"group,omitempty"`
}

UserOrg represents an organization a user belongs to.

Jump to

Keyboard shortcuts

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