linear

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const APIEndpoint = "https://api.linear.app/graphql"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(ctx context.Context, apiKey string) (*Client, error)

func (*Client) AddMemberToTeam added in v0.0.6

func (c *Client) AddMemberToTeam(ctx context.Context, teamId, userId string) (string, error)

func (*Client) Authorize

Authorize returns permissions of user calling the API.

func (*Client) GetOrganization

func (c *Client) GetOrganization(ctx context.Context, paginationVars PaginationVars) (Organization, Tokens, *http.Response, *v2.RateLimitDescription, error)

GetOrganization returns a single Linear organization.

func (*Client) GetProject

func (c *Client) GetProject(ctx context.Context, getProjectVars GetProjectVars) (Project, Tokens, *http.Response, *v2.RateLimitDescription, error)

GetProject returns single Project details.

func (*Client) GetProjects

func (c *Client) GetProjects(ctx context.Context, getResourceVars GetResourcesVars) ([]Project, string, *http.Response, *v2.RateLimitDescription, error)

GetProjects returns all projects from Linear organization.

func (*Client) GetTeam

func (c *Client) GetTeam(ctx context.Context, getTeamVars GetTeamVars) (Team, string, *http.Response, *v2.RateLimitDescription, error)

GetTeam returns single Team details.

func (*Client) GetTeamMemberships added in v0.0.6

func (c *Client) GetTeamMemberships(ctx context.Context, getTeamVars GetTeamVars) ([]TeamMembership, string, *http.Response, *v2.RateLimitDescription, error)

GetTeamMemberships returns team memberships from Linear organization.

func (*Client) GetTeams

func (c *Client) GetTeams(ctx context.Context, getResourceVars GetResourcesVars) ([]Team, string, *http.Response, *v2.RateLimitDescription, error)

GetTeams returns all teams from Linear organization.

func (*Client) GetUsers

func (c *Client) GetUsers(ctx context.Context, getResourceVars GetResourcesVars) ([]User, string, *http.Response, *v2.RateLimitDescription, error)

GetUsers returns all users from Linear organization.

func (*Client) RemoveTeamMembership added in v0.0.6

func (c *Client) RemoveTeamMembership(ctx context.Context, teamMembershipId string) (bool, error)

type GetProjectVars

type GetProjectVars struct {
	First      int    `json:"first,omitempty"`
	UsersAfter string `json:"usersAfter,omitempty"`
	TeamsAfter string `json:"teamsAfter,omitempty"`
	ProjectId  string `json:"projectId,omitempty"`
}

type GetResourcesVars

type GetResourcesVars struct {
	First int    `json:"first,omitempty"`
	After string `json:"after,omitempty"`
}

type GetTeamVars

type GetTeamVars struct {
	TeamId string `json:"teamId"`
	After  string `json:"after,omitempty"`
	First  int    `json:"first,omitempty"`
}

type GraphQLError

type GraphQLError struct {
	Error  string `json:"error"`
	Errors []struct {
		Message string `json:"message"`
	} `json:"errors"`
}

func (*GraphQLError) Message added in v0.0.7

func (e *GraphQLError) Message() string

type GraphQLOrganizationResponse

type GraphQLOrganizationResponse struct {
	Data struct {
		Organization Organization `json:"organization"`
	} `json:"data"`
}

type GraphQLProjectResponse

type GraphQLProjectResponse struct {
	Data struct {
		Project Project `json:"project"`
	} `json:"data"`
}

type GraphQLProjectsResponse

type GraphQLProjectsResponse struct {
	Data struct {
		Projects Projects `json:"projects"`
	} `json:"data"`
}

type GraphQLTeamResponse

type GraphQLTeamResponse struct {
	Data struct {
		Team Team `json:"team"`
	} `json:"data"`
}

type GraphQLTeamsResponse

type GraphQLTeamsResponse struct {
	Data struct {
		Teams Teams `json:"teams"`
	} `json:"data"`
}

type GraphQLUsersResponse

type GraphQLUsersResponse struct {
	Data struct {
		Users Users `json:"users"`
	} `json:"data"`
}

type GraphQLViewerResponse

type GraphQLViewerResponse struct {
	Data struct {
		Viewer ViewerPermissions `json:"viewer"`
	} `json:"data"`
}

type Organization

type Organization struct {
	ID           string      `json:"id"`
	Name         string      `json:"name"`
	SamlEnabled  bool        `json:"samlEnabled"`
	ScimEnabled  bool        `json:"scimEnabled"`
	Subscription interface{} `json:"subscription"`
	URLKey       string      `json:"urlKey"`
	UserCount    int         `json:"userCount"`
	Users        struct {
		Nodes    []User   `json:"nodes"`
		PageInfo PageInfo `json:"pageInfo"`
	} `json:"users"`
	Teams struct {
		Nodes    []Team   `json:"nodes"`
		PageInfo PageInfo `json:"pageInfo"`
	} `json:"teams"`
}

type PageInfo

type PageInfo struct {
	EndCursor       string `json:"endCursor"`
	HasNextPage     bool   `json:"hasNextPage"`
	HasPreviousPage bool   `json:"hasPreviousPage"`
	StartCursor     string `json:"startCursor"`
}

type PageState

type PageState struct {
	Token          string `json:"token"`
	ResourceTypeID string `json:"resource_type_id"`
	ResourceID     string `json:"resource_id"`
}

type PaginationVars

type PaginationVars struct {
	First      int    `json:"first,omitempty"`
	UsersAfter string `json:"usersAfter,omitempty"`
	TeamsAfter string `json:"teamsAfter,omitempty"`
}

type Project

type Project struct {
	Description string `json:"description"`
	ID          string `json:"id"`
	Name        string `json:"name"`
	SlugID      string `json:"slugId"`
	URL         string `json:"url"`
	Teams       struct {
		Nodes    []Team   `json:"nodes"`
		PageInfo PageInfo `json:"pageInfo"`
	} `json:"teams"`
	Members struct {
		Nodes    []User   `json:"nodes"`
		PageInfo PageInfo `json:"pageInfo"`
	} `json:"members"`
}

type ProjectTokensState

type ProjectTokensState struct {
	States       []PageState `json:"states"`
	CurrentState PageState   `json:"current_state"`
}

type Projects

type Projects struct {
	Nodes    []Project `json:"nodes"`
	PageInfo PageInfo  `json:"pageInfo"`
}

type SuccessResponse added in v0.0.6

type SuccessResponse struct {
	Success bool `json:"success"`
}

type Team

type Team struct {
	ID          string      `json:"id"`
	Name        string      `json:"name"`
	Key         string      `json:"key"`
	Description interface{} `json:"description"`
	Memberships struct {
		Nodes    []TeamMembership `json:"nodes"`
		PageInfo PageInfo         `json:"pageInfo"`
	}
}

type TeamMembership added in v0.0.6

type TeamMembership struct {
	ID   string `json:"id"`
	User User   `json:"user"`
	Team Team   `json:"team"`
}

type Teams

type Teams struct {
	Nodes    []Team   `json:"nodes"`
	PageInfo PageInfo `json:"pageInfo"`
}

type Tokens

type Tokens struct {
	UsersToken string `json:"usersToken,omitempty"`
	TeamsToken string `json:"teamsToken,omitempty"`
}

type User

type User struct {
	Active       bool         `json:"active"`
	Admin        bool         `json:"admin"`
	DisplayName  string       `json:"displayName"`
	Email        string       `json:"email"`
	Guest        bool         `json:"guest"`
	ID           string       `json:"id"`
	IsMe         bool         `json:"isMe"`
	Name         string       `json:"name"`
	URL          string       `json:"url"`
	Description  interface{}  `json:"description"`
	Organization Organization `json:"organization"`
	Teams        struct {
		Nodes []Team `json:"nodes"`
	} `json:"teams"`
}

type Users

type Users struct {
	Nodes    []User   `json:"nodes"`
	PageInfo PageInfo `json:"pageInfo"`
}

type ViewerPermissions

type ViewerPermissions struct {
	Guest bool   `json:"guest"`
	Admin bool   `json:"admin"`
	ID    string `json:"id"`
}

Jump to

Keyboard shortcuts

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