Documentation
¶
Overview ¶
Package users provides a client for Snyk v1 Users API.
Index ¶
- type Client
- func (c *Client) Get(ctx context.Context, userID string) (*User, error)
- func (c *Client) GetMe(ctx context.Context) (*User, error)
- func (c *Client) GetOrgNotificationSettings(ctx context.Context, orgID string) (*NotificationSettings, error)
- func (c *Client) GetProjectNotificationSettings(ctx context.Context, orgID, projectID string) (*NotificationSettings, error)
- func (c *Client) UpdateOrgNotificationSettings(ctx context.Context, orgID string, settings *NotificationSettings) (*NotificationSettings, error)
- func (c *Client) UpdateProjectNotificationSettings(ctx context.Context, orgID, projectID string, settings *NotificationSettings) (*NotificationSettings, error)
- type Group
- type NotificationSetting
- type NotificationSettings
- type User
- type UserOrg
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 (*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 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.