api

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client defines the HTTP client used communicate with the Bugsnag data access API. The client is restricted to single organization. See https://bugsnagapiv2.docs.apiary.io for more details

func New

func New(token string) (*Client, error)

New creates a new Bugsnag data access API client

func (*Client) CreateCollaborator

func (c *Client) CreateCollaborator(collab *Collaborator) (*Collaborator, error)

CreateCollaborator creates a new collaborator. If the user does not exist, a user will be created and invited to join the organization

func (*Client) CreateProject

func (c *Client) CreateProject(project *Project) (*Project, error)

CreateProject creates a new project in organization

func (*Client) DeleteCollaborator

func (c *Client) DeleteCollaborator(id string) error

DeleteCollaborator will remove the collaborator from the organization

func (*Client) DeleteProject

func (c *Client) DeleteProject(id string) error

DeleteProject deletes a project in the organization

func (*Client) GetCollaborator

func (c *Client) GetCollaborator(id string) (*Collaborator, error)

GetCollaborator returns a specific collaborator using the provided user ID

func (*Client) GetCurrentOrganization

func (c *Client) GetCurrentOrganization() (string, error)

GetCurrentOrganization returns the ID of the organization associated with the configured data access token

func (*Client) GetOrganization

func (c *Client) GetOrganization() (*Organization, error)

GetOrganization returns the organization associated with the configured data access token

func (*Client) GetProject

func (c *Client) GetProject(id string) (*Project, error)

GetProject returns a specific project using the provided project ID

func (*Client) ListProjects

func (c *Client) ListProjects(query string, sort string, direction string) ([]Project, error)

ListProjects provides a list of projects in the organization. A query string can be provided to narrow down the list of projects based on project name. The list can be sorted.

func (*Client) UpdateCollaborator

func (c *Client) UpdateCollaborator(collab *Collaborator) (*Collaborator, error)

UpdateCollaborator will update access permissions for the specified collaborator

func (*Client) UpdateOrganization

func (c *Client) UpdateOrganization(org *Organization) (*Organization, error)

UpdateOrganization updates organization settings associated with the configured data access token

func (*Client) UpdateProject

func (c *Client) UpdateProject(project *Project) (*Project, error)

UpdateProject updates a project in the organization

type Collaborator

type Collaborator struct {
	ID                     string   `json:"id,omitempty"`
	Name                   string   `json:"name,omitempty"`
	Email                  string   `json:"email,omitempty"`
	Admin                  *bool    `json:"admin,omitempty"`
	Password               string   `json:"password,omitempty"`
	IsAdmin                bool     `json:"is_admin,omitempty"`
	ProjectIDs             []string `json:"project_ids,omitempty"`
	TwoFAEnabled           bool     `json:"two_factor_enabled,omitempty"`
	TwoFAEnabledOn         string   `json:"two_factor_enabled_on,omitempty"`
	RecoveryCodesRemaining int      `json:"recovery_codes_remaining,omitempty"`
	PasswordUpdatedOn      string   `json:"password_updated_on,omitempty"`
	ShowTimeInUTC          bool     `json:"show_time_in_utc,omitempty"`
	CreatedAt              string   `json:"created_at,omitempty"`
	PendingInvitation      bool     `json:"pending_invitation,omitempty"`
	LastRequestAt          string   `json:"last_request_at,omitempty"`
	PaidFor                bool     `json:"paid_for,omitempty"`
}

Collaborator defines the details of a Bugsnag collaborator as provided by the Bugsnag data access api.

type OrgCreator

type OrgCreator struct {
	Email string `json:"email,omitempty"`
	ID    string `json:"id,omitempty"`
	Name  string `json:"name,omitempty"`
}

OrgCreator defines details about the creator of the organization

type Organization

type Organization struct {
	ID            string      `json:"id,omitempty"`
	Name          string      `json:"name,omitempty"`
	BillingEmails []string    `json:"billing_emails,omitempty"`
	AutoUpgrade   *bool       `json:"auto_upgrade,omitempty"`
	Slug          string      `json:"slug,omitempty"`
	Creator       *OrgCreator `json:"creator,omitempty"`
	CreatedAt     string      `json:"created_at,omitempty"`
	UpdatedAt     string      `json:"updated_at,omitempty"`
}

Organization defines the details of a Bugsnag organization as provided by the Bugsnag data access API

type Project

type Project struct {
	ID        string `json:"id,omitempty"`
	Name      string `json:"name,omitempty"`
	Type      string `json:"type,omitempty"`
	APIKey    string `json:"api_key,omitempty"`
	Slug      string `json:"slug,omitempty"`
	URL       string `json:"url,omitempty"`
	HTMLURL   string `json:"html_url,omitempty"`
	CreatedAt string `json:"created_at,omitempty"`
	UpdatedAt string `json:"updated_at,omitempty"`
}

Project defines the details of a Bugsnag project as provided by the Bugsnag data access API.

Jump to

Keyboard shortcuts

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