sentry

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoleMember  string = "member"
	RoleBilling string = "billing"
	RoleAdmin   string = "admin"
	RoleOwner   string = "owner"
	RoleManager string = "manager"
)
View Source
const (
	DefaultBaseURL = "https://sentry.io/api/"
	APIVersion     = "0"
)

public constants for external use

Variables

This section is empty.

Functions

func Bool added in v1.1.0

func Bool(v bool) *bool

Bool returns a pointer to the bool value.

Types

type APIError

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

APIError represents a Sentry API Error response. Should look like:

type apiError struct {
	Detail string `json:"detail"`
}

func (APIError) Empty

func (e APIError) Empty() bool

Empty returns true if empty.

func (APIError) Error

func (e APIError) Error() string

func (*APIError) MarshalJSON added in v1.5.0

func (e *APIError) MarshalJSON() ([]byte, error)

func (*APIError) UnmarshalJSON added in v1.5.0

func (e *APIError) UnmarshalJSON(b []byte) error

type APMRule added in v1.5.0

type APMRule struct {
	ID               string    `json:"id"`
	Name             string    `json:"name"`
	Environment      *string   `json:"environment,omitempty"`
	DataSet          string    `json:"dataset"`
	Query            string    `json:"query"`
	Aggregate        string    `json:"aggregate"`
	TimeWindow       float64   `json:"timeWindow"`
	ThresholdType    int       `json:"thresholdType"`
	ResolveThreshold float64   `json:"resolveThreshold"`
	Triggers         []Trigger `json:"triggers"`
	Projects         []string  `json:"projects"`
	Owner            string    `json:"owner"`
	Created          time.Time `json:"dateCreated"`
}

type APMRuleService added in v1.5.0

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

func (*APMRuleService) Create added in v1.5.0

func (s *APMRuleService) Create(organizationSlug string, projectSlug string, params *CreateAPMRuleParams) (*APMRule, *http.Response, error)

Create a new APM rule bound to a project.

func (*APMRuleService) Delete added in v1.5.0

func (s *APMRuleService) Delete(organizationSlug string, projectSlug string, apmRuleID string) (*http.Response, error)

Delete a APM rule.

func (*APMRuleService) List added in v1.5.0

func (s *APMRuleService) List(organizationSlug string, projectSlug string) ([]APMRule, *http.Response, error)

List APM rules configured for a project

func (*APMRuleService) Update added in v1.5.0

func (s *APMRuleService) Update(organizationSlug string, projectSlug string, apmRuleID string, params *APMRule) (*APMRule, *http.Response, error)

Update a APM rule.

type ActionType added in v1.5.0

type ActionType map[string]interface{}

ActionType for defining actions.

type Avatar added in v1.5.0

type Avatar struct {
	UUID *string `json:"avatarUuid"`
	Type string  `json:"avatarType"`
}

Avatar represents an avatar.

type Client

type Client struct {
	Organizations       *OrganizationService
	OrganizationMembers *OrganizationMemberService
	Teams               *TeamService
	Projects            *ProjectService
	ProjectKeys         *ProjectKeyService
	ProjectPlugins      *ProjectPluginService
	Rules               *RuleService
	APMRules            *APMRuleService
	Ownership           *ProjectOwnershipService
	// contains filtered or unexported fields
}

Client for sentry api

func NewClient

func NewClient(httpClient *http.Client, baseURL *url.URL, token string) *Client

NewClient returns a new Sentry API client. If a nil httpClient is given, the http.DefaultClient will be used. If a nil baseURL is given, the DefaultBaseURL will be used.

type ConditionType added in v1.5.0

type ConditionType map[string]interface{}

ConditionType for defining conditions.

type CreateAPMRuleParams added in v1.5.0

type CreateAPMRuleParams struct {
	Name             string    `json:"name"`
	Environment      *string   `json:"environment,omitempty"`
	DataSet          string    `json:"dataset"`
	Query            string    `json:"query"`
	Aggregate        string    `json:"aggregate"`
	TimeWindow       float64   `json:"timeWindow"`
	ThresholdType    int       `json:"thresholdType"`
	ResolveThreshold float64   `json:"resolveThreshold"`
	Triggers         []Trigger `json:"triggers"`
	Projects         []string  `json:"projects"`
	Owner            string    `json:"owner"`
}

type CreateOrganizationMemberParams added in v1.5.0

type CreateOrganizationMemberParams struct {
	Email string   `json:"email"`
	Role  string   `json:"role"`
	Teams []string `json:"teams,omitempty"`
}

type CreateOrganizationParams

type CreateOrganizationParams struct {
	Name       string `json:"name,omitempty"`
	Slug       string `json:"slug,omitempty"`
	AgreeTerms *bool  `json:"agreeTerms,omitempty"`
}

CreateOrganizationParams are the parameters for OrganizationService.Create.

type CreateProjectKeyParams

type CreateProjectKeyParams struct {
	Name      string               `json:"name,omitempty"`
	RateLimit *ProjectKeyRateLimit `json:"rateLimit,omitempty"`
}

CreateProjectKeyParams are the parameters for ProjectKeyService.Create.

type CreateProjectParams

type CreateProjectParams struct {
	Name     string `json:"name,omitempty"`
	Slug     string `json:"slug,omitempty"`
	Platform string `json:"platform,omitempty"`
}

CreateProjectParams are the parameters for ProjectService.Create.

type CreateRuleActionParams added in v1.5.0

type CreateRuleActionParams struct {
	ID        string `json:"id"`
	Tags      string `json:"tags"`
	Channel   string `json:"channel"`
	Workspace string `json:"workspace"`
}

CreateRuleActionParams models the actions when creating the action for the rule.

type CreateRuleConditionParams added in v1.5.0

type CreateRuleConditionParams struct {
	ID       string `json:"id"`
	Interval string `json:"interval"`
	Value    int    `json:"value"`
	Level    int    `json:"level"`
	Match    string `json:"match"`
}

CreateRuleConditionParams models the conditions when creating the action for the rule.

type CreateRuleParams added in v1.5.0

type CreateRuleParams struct {
	ActionMatch string          `json:"actionMatch"`
	FilterMatch string          `json:"filterMatch"`
	Environment string          `json:"environment,omitempty"`
	Frequency   int             `json:"frequency"`
	Name        string          `json:"name"`
	Conditions  []ConditionType `json:"conditions"`
	Actions     []ActionType    `json:"actions"`
	Filters     []FilterType    `json:"filters"`
}

CreateRuleParams are the parameters for RuleService.Create.

type CreateTeamParams

type CreateTeamParams struct {
	Name string `json:"name,omitempty"`
	Slug string `json:"slug,omitempty"`
}

CreateTeamParams are the parameters for TeamService.Create.

type FilterType added in v1.5.0

type FilterType map[string]interface{}

FilterType for defining actions.

type ListOrganizationMemberParams added in v1.5.0

type ListOrganizationMemberParams struct {
	Cursor string `url:"cursor,omitempty"`
}

ListOrganizationMemberParams are the parameters for OrganizationMemberService.List.

type ListOrganizationParams

type ListOrganizationParams struct {
	Cursor string `url:"cursor,omitempty"`
}

ListOrganizationParams are the parameters for OrganizationService.List.

type Organization

type Organization struct {
	ID             string             `json:"id"`
	Slug           string             `json:"slug"`
	Status         OrganizationStatus `json:"status"`
	Name           string             `json:"name"`
	DateCreated    time.Time          `json:"dateCreated"`
	IsEarlyAdopter bool               `json:"isEarlyAdopter"`
	Avatar         Avatar             `json:"avatar"`

	Quota OrganizationQuota `json:"quota"`

	IsDefault            bool                        `json:"isDefault"`
	DefaultRole          string                      `json:"defaultRole"`
	AvailableRoles       []OrganizationAvailableRole `json:"availableRoles"`
	OpenMembership       bool                        `json:"openMembership"`
	Require2FA           bool                        `json:"require2FA"`
	AllowSharedIssues    bool                        `json:"allowSharedIssues"`
	EnhancedPrivacy      bool                        `json:"enhancedPrivacy"`
	DataScrubber         bool                        `json:"dataScrubber"`
	DataScrubberDefaults bool                        `json:"dataScrubberDefaults"`
	SensitiveFields      []string                    `json:"sensitiveFields"`
	SafeFields           []string                    `json:"safeFields"`
	ScrubIPAddresses     bool                        `json:"scrubIPAddresses"`

	Access                []string `json:"access"`
	Features              []string `json:"features"`
	PendingAccessRequests int      `json:"pendingAccessRequests"`

	AccountRateLimit int `json:"accountRateLimit"`
	ProjectRateLimit int `json:"projectRateLimit"`

	Teams    []Team           `json:"teams"`
	Projects []ProjectSummary `json:"projects"`
}

Organization represents a Sentry organization. Based on https://github.com/getsentry/sentry/blob/9.0.0/src/sentry/api/serializers/models/organization.py

type OrganizationAvailableRole

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

OrganizationAvailableRole represents a Sentry organization's available role.

type OrganizationMember added in v1.5.0

type OrganizationMember struct {
	ID           string          `json:"id"`
	Email        string          `json:"email"`
	Name         string          `json:"name"`
	User         User            `json:"user"`
	Role         string          `json:"role"`
	RoleName     string          `json:"roleName"`
	Pending      bool            `json:"pending"`
	Expired      bool            `json:"expired"`
	Flags        map[string]bool `json:"flags"`
	DateCreated  time.Time       `json:"dateCreated"`
	InviteStatus string          `json:"inviteStatus"`
	InviterName  *string         `json:"inviterName"`
	Teams        []string        `json:"teams"`
}

OrganizationMember represents a User's membership to the organization. https://github.com/getsentry/sentry/blob/275e6efa0f364ce05d9bfd09386b895b8a5e0671/src/sentry/api/serializers/models/organization_member.py#L12

type OrganizationMemberService added in v1.5.0

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

OrganizationMemberService provides methods for accessing Sentry membership API endpoints.

func (*OrganizationMemberService) Create added in v1.5.0

func (*OrganizationMemberService) Delete added in v1.5.0

func (s *OrganizationMemberService) Delete(organizationSlug string, memberId string) (*http.Response, error)

func (*OrganizationMemberService) Get added in v1.5.0

func (s *OrganizationMemberService) Get(organizationSlug string, memberId string) (*OrganizationMember, *http.Response, error)

func (*OrganizationMemberService) List added in v1.5.0

List organization members.

func (*OrganizationMemberService) Update added in v1.5.0

func (s *OrganizationMemberService) Update(organizationSlug string, memberId string, params *UpdateOrganizationMemberParams) (*OrganizationMember, *http.Response, error)

type OrganizationQuota

type OrganizationQuota struct {
	MaxRate         int `json:"maxRate"`
	MaxRateInterval int `json:"maxRateInterval"`
	AccountLimit    int `json:"accountLimit"`
	ProjectLimit    int `json:"projectLimit"`
}

OrganizationQuota represents a Sentry organization's quota.

type OrganizationService

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

OrganizationService provides methods for accessing Sentry organization API endpoints. https://docs.sentry.io/api/organizations/

func (*OrganizationService) Create

Create a new Sentry organization. https://docs.sentry.io/api/organizations/post-organization-index/

func (*OrganizationService) Delete

func (s *OrganizationService) Delete(slug string) (*http.Response, error)

Delete a Sentry organization.

func (*OrganizationService) Get

Get a Sentry organization. https://docs.sentry.io/api/organizations/get-organization-details/

func (*OrganizationService) List

List organizations available to the authenticated session. https://docs.sentry.io/api/organizations/get-organization-index/

func (*OrganizationService) Update

Update a Sentry organization. https://docs.sentry.io/api/organizations/put-organization-details/

type OrganizationStatus added in v1.5.0

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

OrganizationStatus represents a Sentry organization's status.

type Project

type Project struct {
	ID   string `json:"id"`
	Slug string `json:"slug"`
	Name string `json:"name"`

	IsPublic     bool   `json:"isPublic"`
	IsBookmarked bool   `json:"isBookmarked"`
	Color        string `json:"color"`

	DateCreated time.Time `json:"dateCreated"`
	FirstEvent  time.Time `json:"firstEvent"`

	Features []string `json:"features"`
	Status   string   `json:"status"`
	Platform string   `json:"platform"`

	IsInternal bool `json:"isInternal"`
	IsMember   bool `json:"isMember"`
	HasAccess  bool `json:"hasAccess"`

	Avatar Avatar `json:"avatar"`

	// TODO: latestRelease
	Options map[string]interface{} `json:"options"`

	DigestsMinDelay      int      `json:"digestsMinDelay"`
	DigestsMaxDelay      int      `json:"digestsMaxDelay"`
	SubjectPrefix        string   `json:"subjectPrefix"`
	AllowedDomains       []string `json:"allowedDomains"`
	ResolveAge           int      `json:"resolveAge"`
	DataScrubber         bool     `json:"dataScrubber"`
	DataScrubberDefaults bool     `json:"dataScrubberDefaults"`
	SafeFields           []string `json:"safeFields"`
	SensitiveFields      []string `json:"sensitiveFields"`
	SubjectTemplate      string   `json:"subjectTemplate"`
	SecurityToken        string   `json:"securityToken"`
	SecurityTokenHeader  *string  `json:"securityTokenHeader"`
	VerifySSL            bool     `json:"verifySSL"`
	ScrubIPAddresses     bool     `json:"scrubIPAddresses"`
	ScrapeJavaScript     bool     `json:"scrapeJavaScript"`

	Organization Organization `json:"organization"`
	// TODO: plugins
	// TODO: platforms
	ProcessingIssues int `json:"processingIssues"`

	Team  Team   `json:"team"`
	Teams []Team `json:"teams"`
}

Project represents a Sentry project. https://github.com/getsentry/sentry/blob/9.0.0/src/sentry/api/serializers/models/project.py

type ProjectKey

type ProjectKey struct {
	ID          string               `json:"id"`
	Name        string               `json:"name"`
	Label       string               `json:"label"`
	Public      string               `json:"public"`
	Secret      string               `json:"secret"`
	ProjectID   int                  `json:"projectId"`
	IsActive    bool                 `json:"isActive"`
	RateLimit   *ProjectKeyRateLimit `json:"rateLimit"`
	DSN         ProjectKeyDSN        `json:"dsn"`
	DateCreated time.Time            `json:"dateCreated"`
}

ProjectKey represents a client key bound to a project. https://github.com/getsentry/sentry/blob/9.0.0/src/sentry/api/serializers/models/project_key.py

type ProjectKeyDSN

type ProjectKeyDSN struct {
	Secret   string `json:"secret"`
	Public   string `json:"public"`
	CSP      string `json:"csp"`
	Security string `json:"security"`
	Minidump string `json:"minidump"`
	CDN      string `json:"cdn"`
}

ProjectKeyDSN represents a project key's DSN.

type ProjectKeyRateLimit

type ProjectKeyRateLimit struct {
	Window int `json:"window"`
	Count  int `json:"count"`
}

ProjectKeyRateLimit represents a project key's rate limit.

type ProjectKeyService

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

ProjectKeyService provides methods for accessing Sentry project client key API endpoints. https://docs.sentry.io/api/projects/

func (*ProjectKeyService) Create

func (s *ProjectKeyService) Create(organizationSlug string, projectSlug string, params *CreateProjectKeyParams) (*ProjectKey, *http.Response, error)

Create a new client key bound to a project. https://docs.sentry.io/api/projects/post-project-keys/

func (*ProjectKeyService) Delete

func (s *ProjectKeyService) Delete(organizationSlug string, projectSlug string, keyID string) (*http.Response, error)

Delete a project. https://docs.sentry.io/api/projects/delete-project-details/

func (*ProjectKeyService) List

func (s *ProjectKeyService) List(organizationSlug string, projectSlug string) ([]ProjectKey, *http.Response, error)

List client keys bound to a project. https://docs.sentry.io/api/projects/get-project-keys/

func (*ProjectKeyService) Update

func (s *ProjectKeyService) Update(organizationSlug string, projectSlug string, keyID string, params *UpdateProjectKeyParams) (*ProjectKey, *http.Response, error)

Update a client key. https://docs.sentry.io/api/projects/put-project-key-details/

type ProjectOwnership added in v1.5.0

type ProjectOwnership struct {
	Raw                string    `json:"raw"`
	FallThrough        bool      `json:"fallthrough"`
	DateCreated        time.Time `json:"dateCreated"`
	LastUpdated        time.Time `json:"lastUpdated"`
	IsActive           bool      `json:"isActive"`
	AutoAssignment     bool      `json:"autoAssignment"`
	CodeownersAutoSync *bool     `json:"codeownersAutoSync,omitempty"`
}

https://github.com/getsentry/sentry/blob/master/src/sentry/api/serializers/models/projectownership.py

type ProjectOwnershipService added in v1.5.0

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

ProjectOwnershipService provides methods for accessing Sentry project client key API endpoints.

func (*ProjectOwnershipService) Get added in v1.5.0

func (s *ProjectOwnershipService) Get(organizationSlug string, projectSlug string) (*ProjectOwnership, *http.Response, error)

Get details on a project's ownership configuration.

func (*ProjectOwnershipService) Update added in v1.5.0

func (s *ProjectOwnershipService) Update(organizationSlug string, projectSlug string, params *UpdateProjectOwnershipParams) (*ProjectOwnership, *http.Response, error)

Update a Project's Ownership configuration

type ProjectPlugin

type ProjectPlugin struct {
	ID         string                 `json:"id"`
	Name       string                 `json:"name"`
	Type       string                 `json:"type"`
	CanDisable bool                   `json:"canDisable"`
	IsTestable bool                   `json:"isTestable"`
	Metadata   map[string]interface{} `json:"metadata"`
	Contexts   []string               `json:"contexts"`
	Status     string                 `json:"status"`
	Assets     []ProjectPluginAsset   `json:"assets"`
	Doc        string                 `json:"doc"`
	Config     []ProjectPluginConfig  `json:"config"`
}

ProjectPlugin represents a plugin bound to a project. Based on https://github.com/getsentry/sentry/blob/96bc1c63df5ec73fe12c136ada11561bf52f1ec9/src/sentry/api/serializers/models/plugin.py#L11.

type ProjectPluginAsset

type ProjectPluginAsset struct {
	URL string `json:"url"`
}

ProjectPluginAsset represents an asset of a plugin.

type ProjectPluginConfig

type ProjectPluginConfig struct {
	Name         string          `json:"name"`
	Label        string          `json:"label"`
	Type         string          `json:"type"`
	Required     bool            `json:"required"`
	Help         string          `json:"help"`
	Placeholder  string          `json:"placeholder"`
	Choices      json.RawMessage `json:"choices"`
	ReadOnly     bool            `json:"readonly"`
	DefaultValue interface{}     `json:"defaultValue"`
	Value        interface{}     `json:"value"`
}

ProjectPluginConfig represents the configuration of a plugin. Based on https://github.com/getsentry/sentry/blob/96bc1c63df5ec73fe12c136ada11561bf52f1ec9/src/sentry/api/serializers/models/plugin.py#L62-L94.

type ProjectPluginService

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

ProjectPluginService provides methods for accessing Sentry project plugin API endpoints.

func (*ProjectPluginService) Disable

func (s *ProjectPluginService) Disable(organizationSlug string, projectSlug string, id string) (*http.Response, error)

Disable a project plugin.

func (*ProjectPluginService) Enable

func (s *ProjectPluginService) Enable(organizationSlug string, projectSlug string, id string) (*http.Response, error)

Enable a project plugin.

func (*ProjectPluginService) Get

func (s *ProjectPluginService) Get(organizationSlug string, projectSlug string, id string) (*ProjectPlugin, *http.Response, error)

Get details of a project plugin.

func (*ProjectPluginService) List

func (s *ProjectPluginService) List(organizationSlug string, projectSlug string) ([]ProjectPlugin, *http.Response, error)

List plugins bound to a project.

func (*ProjectPluginService) Update

func (s *ProjectPluginService) Update(organizationSlug string, projectSlug string, id string, params UpdateProjectPluginParams) (*ProjectPlugin, *http.Response, error)

Update settings for a given team. https://docs.sentry.io/api/teams/put-team-details/

type ProjectService

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

ProjectService provides methods for accessing Sentry project API endpoints. https://docs.sentry.io/api/projects/

func (*ProjectService) AddTeam added in v1.5.0

func (s *ProjectService) AddTeam(organizationSlug string, slug string, teamSlug string) (*Project, *http.Response, error)

AddTeam add a team to a project.

func (*ProjectService) Create

func (s *ProjectService) Create(organizationSlug string, teamSlug string, params *CreateProjectParams) (*Project, *http.Response, error)

Create a new project bound to a team. https://docs.sentry.io/api/teams/post-team-project-index/

func (*ProjectService) Delete

func (s *ProjectService) Delete(organizationSlug string, slug string) (*http.Response, error)

Delete a project. https://docs.sentry.io/api/projects/delete-project-details/

func (*ProjectService) Get

func (s *ProjectService) Get(organizationSlug string, slug string) (*Project, *http.Response, error)

Get details on an individual project. https://docs.sentry.io/api/projects/get-project-details/

func (*ProjectService) List

func (s *ProjectService) List() ([]Project, *http.Response, error)

List projects available. https://docs.sentry.io/api/projects/get-project-index/

func (*ProjectService) RemoveTeam added in v1.5.0

func (s *ProjectService) RemoveTeam(organizationSlug string, slug string, teamSlug string) (*http.Response, error)

RemoveTeam remove a team from a project.

func (*ProjectService) Update

func (s *ProjectService) Update(organizationSlug string, slug string, params *UpdateProjectParams) (*Project, *http.Response, error)

Update various attributes and configurable settings for a given project. https://docs.sentry.io/api/projects/put-project-details/

type ProjectSummary added in v1.5.0

type ProjectSummary struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	Slug         string `json:"slug"`
	IsBookmarked bool   `json:"isBookmarked"`
	IsMember     bool   `json:"isMember"`
	HasAccess    bool   `json:"hasAccess"`

	DateCreated time.Time `json:"dateCreated"`
	FirstEvent  time.Time `json:"firstEvent"`

	Platform  *string  `json:"platform"`
	Platforms []string `json:"platforms"`

	Team  *ProjectSummaryTeam  `json:"team"`
	Teams []ProjectSummaryTeam `json:"teams"`
}

ProjectSummary represents the summary of a Sentry project. https://github.com/getsentry/sentry/blob/9.0.0/src/sentry/api/serializers/models/project.py#L258

type ProjectSummaryTeam added in v1.5.0

type ProjectSummaryTeam struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Slug string `json:"slug"`
}

ProjectSummaryTeam represents a team in a ProjectSummary. https://github.com/getsentry/sentry/blob/9.0.0/src/sentry/api/serializers/models/project.py#L223

type Rule added in v1.5.0

type Rule struct {
	ID          string          `json:"id"`
	ActionMatch string          `json:"actionMatch"`
	FilterMatch string          `json:"filterMatch"`
	Environment *string         `json:"environment,omitempty"`
	Frequency   int             `json:"frequency"`
	Name        string          `json:"name"`
	Conditions  []ConditionType `json:"conditions"`
	Actions     []ActionType    `json:"actions"`
	Filters     []FilterType    `json:"filters"`
	Created     time.Time       `json:"dateCreated"`
}

Rule represents an alert rule configured for this project. https://github.com/getsentry/sentry/blob/9.0.0/src/sentry/api/serializers/models/rule.py

type RuleService added in v1.5.0

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

RuleService provides methods for accessing Sentry project client key API endpoints. https://docs.sentry.io/api/projects/

func (*RuleService) Create added in v1.5.0

func (s *RuleService) Create(organizationSlug string, projectSlug string, params *CreateRuleParams) (*Rule, *http.Response, error)

Create a new alert rule bound to a project.

func (*RuleService) Delete added in v1.5.0

func (s *RuleService) Delete(organizationSlug string, projectSlug string, ruleID string) (*http.Response, error)

Delete a rule.

func (*RuleService) List added in v1.5.0

func (s *RuleService) List(organizationSlug string, projectSlug string) ([]Rule, *http.Response, error)

List alert rules configured for a project.

func (*RuleService) Update added in v1.5.0

func (s *RuleService) Update(organizationSlug string, projectSlug string, ruleID string, params *Rule) (*Rule, *http.Response, error)

Update a rule.

type Team

type Team struct {
	ID          string    `json:"id"`
	Slug        string    `json:"slug"`
	Name        string    `json:"name"`
	DateCreated time.Time `json:"dateCreated"`
	IsMember    bool      `json:"isMember"`
	HasAccess   bool      `json:"hasAccess"`
	IsPending   bool      `json:"isPending"`
	Avatar      Avatar    `json:"avatar"`
}

Team represents a Sentry team that is bound to an organization. https://github.com/getsentry/sentry/blob/9.0.0/src/sentry/api/serializers/models/team.py#L48

type TeamService

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

TeamService provides methods for accessing Sentry team API endpoints. https://docs.sentry.io/api/teams/

func (*TeamService) Create

func (s *TeamService) Create(organizationSlug string, params *CreateTeamParams) (*Team, *http.Response, error)

Create a new Sentry team bound to an organization. https://docs.sentry.io/api/teams/post-organization-teams/

func (*TeamService) Delete

func (s *TeamService) Delete(organizationSlug string, slug string) (*http.Response, error)

Delete a team. https://docs.sentry.io/api/teams/delete-team-details/

func (*TeamService) Get

func (s *TeamService) Get(organizationSlug string, slug string) (*Team, *http.Response, error)

Get details on an individual team of an organization. https://docs.sentry.io/api/teams/get-team-details/

func (*TeamService) List

func (s *TeamService) List(organizationSlug string) ([]Team, *http.Response, error)

List returns a list of teams bound to an organization. https://docs.sentry.io/api/teams/get-organization-teams/

func (*TeamService) Update

func (s *TeamService) Update(organizationSlug string, slug string, params *UpdateTeamParams) (*Team, *http.Response, error)

Update settings for a given team. https://docs.sentry.io/api/teams/put-team-details/

type Trigger added in v1.5.0

type Trigger map[string]interface{}

type UpdateOrganizationMemberParams added in v1.5.0

type UpdateOrganizationMemberParams struct {
	Role  string   `json:"role"`
	Teams []string `json:"teams,omitempty"`
}

type UpdateOrganizationParams

type UpdateOrganizationParams struct {
	Name string `json:"name,omitempty"`
	Slug string `json:"slug,omitempty"`
}

UpdateOrganizationParams are the parameters for OrganizationService.Update.

type UpdateProjectKeyParams

type UpdateProjectKeyParams struct {
	Name      string               `json:"name,omitempty"`
	RateLimit *ProjectKeyRateLimit `json:"rateLimit,omitempty"`
}

UpdateProjectKeyParams are the parameters for ProjectKeyService.Update.

type UpdateProjectOwnershipParams added in v1.5.0

type UpdateProjectOwnershipParams struct {
	Raw                string `json:"raw,omitempty"`
	FallThrough        *bool  `json:"fallthrough,omitempty"`
	AutoAssignment     *bool  `json:"autoAssignment,omitempty"`
	CodeownersAutoSync *bool  `json:"codeownersAutoSync,omitempty"`
}

CreateProjectParams are the parameters for ProjectOwnershipService.Update.

type UpdateProjectParams

type UpdateProjectParams struct {
	Name            string                 `json:"name,omitempty"`
	Slug            string                 `json:"slug,omitempty"`
	Platform        string                 `json:"platform,omitempty"`
	IsBookmarked    *bool                  `json:"isBookmarked,omitempty"`
	DigestsMinDelay *int                   `json:"digestsMinDelay,omitempty"`
	DigestsMaxDelay *int                   `json:"digestsMaxDelay,omitempty"`
	ResolveAge      *int                   `json:"resolveAge,omitempty"`
	Options         map[string]interface{} `json:"options,omitempty"`
	AllowedDomains  []string               `json:"allowedDomains,omitempty"`
}

UpdateProjectParams are the parameters for ProjectService.Update.

type UpdateProjectPluginParams

type UpdateProjectPluginParams map[string]interface{}

UpdateProjectPluginParams are the parameters for TeamService.Update.

type UpdateTeamParams

type UpdateTeamParams struct {
	Name string `json:"name,omitempty"`
	Slug string `json:"slug,omitempty"`
}

UpdateTeamParams are the parameters for TeamService.Update.

type User added in v1.5.0

type User struct {
	ID              string      `json:"id"`
	Name            string      `json:"name"`
	Username        string      `json:"username"`
	Email           string      `json:"email"`
	AvatarURL       string      `json:"avatarUrl"`
	IsActive        bool        `json:"isActive"`
	HasPasswordAuth bool        `json:"hasPasswordAuth"`
	IsManaged       bool        `json:"isManaged"`
	DateJoined      time.Time   `json:"dateJoined"`
	LastLogin       time.Time   `json:"lastLogin"`
	Has2FA          bool        `json:"has2fa"`
	LastActive      time.Time   `json:"lastActive"`
	IsSuperuser     bool        `json:"isSuperuser"`
	IsStaff         bool        `json:"isStaff"`
	Avatar          UserAvatar  `json:"avatar"`
	Emails          []UserEmail `json:"emails"`
}

User represents a Sentry User. https://github.com/getsentry/sentry/blob/275e6efa0f364ce05d9bfd09386b895b8a5e0671/src/sentry/api/serializers/models/user.py#L35

type UserAvatar added in v1.5.0

type UserAvatar struct {
	AvatarType string  `json:"avatarType"`
	AvatarUUID *string `json:"avatarUuid"`
}

type UserEmail added in v1.5.0

type UserEmail struct {
	ID         string `json:"id"`
	Email      string `json:"email"`
	IsVerified bool   `json:"is_verified"`
}

Jump to

Keyboard shortcuts

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