listssrht

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PermissionIcon

func PermissionIcon(permission bool) string

Types

type ACL

type ACL struct {
	// Permission to browse or subscribe to emails
	Browse bool `json:"browse"`
	// Permission to reply to existing threads
	Reply bool `json:"reply"`
	// Permission to start new threads
	Post bool `json:"post"`
	// Permission to moderate the list
	Moderate bool `json:"moderate"`

	// Underlying value of the GraphQL interface
	Value ACLValue `json:"-"`
}

func (*ACL) UnmarshalJSON added in v0.4.0

func (base *ACL) UnmarshalJSON(b []byte) error

type ACLInput

type ACLInput struct {
	Browse   bool `json:"browse"`
	Reply    bool `json:"reply"`
	Post     bool `json:"post"`
	Moderate bool `json:"moderate"`
}

type ACLValue added in v0.4.0

type ACLValue interface {
	// contains filtered or unexported methods
}

ACLValue is one of: MailingListACL | GeneralACL

type AccessKind

type AccessKind string
const (
	AccessKindRo AccessKind = "RO"
	AccessKindRw AccessKind = "RW"
)

type AccessScope

type AccessScope string
const (
	AccessScopeAcls          AccessScope = "ACLS"
	AccessScopeEmails        AccessScope = "EMAILS"
	AccessScopeLists         AccessScope = "LISTS"
	AccessScopePatches       AccessScope = "PATCHES"
	AccessScopeProfile       AccessScope = "PROFILE"
	AccessScopeSubscriptions AccessScope = "SUBSCRIPTIONS"
)

type ActivitySubscription

type ActivitySubscription struct {
	Id      int32          `json:"id"`
	Created gqlclient.Time `json:"created"`

	// Underlying value of the GraphQL interface
	Value ActivitySubscriptionValue `json:"-"`
}

func (*ActivitySubscription) UnmarshalJSON added in v0.4.0

func (base *ActivitySubscription) UnmarshalJSON(b []byte) error

type ActivitySubscriptionCursor

type ActivitySubscriptionCursor struct {
	Results []ActivitySubscription `json:"results"`
	Cursor  *Cursor                `json:"cursor,omitempty"`
}

A cursor for enumerating subscriptions

If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.

func Subscriptions added in v0.4.0

func Subscriptions(client *gqlclient.Client, ctx context.Context, cursor *Cursor) (subscriptions *ActivitySubscriptionCursor, err error)

type ActivitySubscriptionValue added in v0.4.0

type ActivitySubscriptionValue interface {
	// contains filtered or unexported methods
}

ActivitySubscriptionValue is one of: MailingListSubscription

type ByteRange added in v0.2.0

type ByteRange struct {
	// Inclusive start byte offset.
	Start int32 `json:"start"`
	// Exclusive end byte offset.
	End int32 `json:"end"`
}

A byte range.

type Cursor

type Cursor string

Opaque string

type Email

type Email struct {
	Id int32 `json:"id"`
	// The entity which sent this email. Will be a User if it can be associated
	// with an account, or a Mailbox otherwise.
	Sender *Entity `json:"sender"`
	// Time we received this email (non-forgable).
	Received gqlclient.Time `json:"received"`
	// Time given by Date header (forgable).
	Date gqlclient.Time `json:"date,omitempty"`
	// The Subject header.
	Subject string `json:"subject"`
	// The Message-ID header, without angle brackets.
	MessageID string `json:"messageID"`
	// The In-Reply-To header, if present, without angle brackets.
	InReplyTo *string `json:"inReplyTo,omitempty"`
	// Provides the value (or values) of a specific header from this email. Note
	// that the returned value is coerced to UTF-8 and may be lossy under certain
	// circumstances.
	Header []string `json:"header"`
	// Retrieves the value of an address list header, such as To or Cc.
	AddressList []Mailbox `json:"addressList"`
	// The decoded text/plain message part of the email, i.e. email body.
	Body string `json:"body"`
	// A URL from which the full raw message envelope may be downloaded.
	Envelope URL          `json:"envelope"`
	Thread   *Thread      `json:"thread"`
	Parent   *Email       `json:"parent,omitempty"`
	Patch    *Patch       `json:"patch,omitempty"`
	Patchset *Patchset    `json:"patchset,omitempty"`
	List     *MailingList `json:"list"`
}

type EmailCursor

type EmailCursor struct {
	Results []Email `json:"results"`
	Cursor  *Cursor `json:"cursor,omitempty"`
}

A cursor for enumerating emails

If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.

type EmailEvent added in v0.2.0

type EmailEvent struct {
	Uuid  string         `json:"uuid"`
	Event WebhookEvent   `json:"event"`
	Date  gqlclient.Time `json:"date"`
	Email *Email         `json:"email"`
}

type Entity

type Entity struct {
	CanonicalName string `json:"canonicalName"`

	// Underlying value of the GraphQL interface
	Value EntityValue `json:"-"`
}

func (*Entity) UnmarshalJSON added in v0.4.0

func (base *Entity) UnmarshalJSON(b []byte) error

type EntityValue added in v0.4.0

type EntityValue interface {
	// contains filtered or unexported methods
}

EntityValue is one of: User | Mailbox

type GeneralACL

type GeneralACL struct {
	Browse   bool `json:"browse"`
	Reply    bool `json:"reply"`
	Post     bool `json:"post"`
	Moderate bool `json:"moderate"`
}

An ACL entry that applies "generally", for example the rights which apply to all subscribers to a list.

func (GeneralACL) TermString

func (acl GeneralACL) TermString() string

type Mailbox

type Mailbox struct {
	CanonicalName string `json:"canonicalName"`
	Name          string `json:"name"`
	Address       string `json:"address"`
}

A mailbox not associated with a registered user

type MailingList

type MailingList struct {
	Id          int32          `json:"id"`
	Created     gqlclient.Time `json:"created"`
	Updated     gqlclient.Time `json:"updated"`
	Name        string         `json:"name"`
	Owner       *Entity        `json:"owner"`
	Description *string        `json:"description,omitempty"`
	Visibility  Visibility     `json:"visibility"`
	// List of globs for permitted or rejected mimetypes on this list
	// e.g. text/*
	PermitMime []string `json:"permitMime"`
	RejectMime []string `json:"rejectMime"`
	// List of threads on this list in order of most recently bumped
	Threads *ThreadCursor `json:"threads"`
	// List of emails received on this list in reverse chronological order
	Emails *EmailCursor `json:"emails"`
	// List of patches received on this list in order of most recently bumped
	Patches *PatchsetCursor `json:"patches"`
	// True if an import operation is underway for this list
	Importing bool `json:"importing"`
	// The access that applies to this user for this list
	Access *ACL `json:"access"`
	// The user's subscription for this list, if any
	Subscription *MailingListSubscription `json:"subscription,omitempty"`
	// URLs to application/mbox archives for this mailing list
	Archive    URL `json:"archive"`
	Last30days URL `json:"last30days"`
	// Access control list entries for this mailing list
	Acl        *MailingListACLCursor `json:"acl"`
	DefaultACL *GeneralACL           `json:"defaultACL"`
	// Returns a list of mailing list webhook subscriptions. For clients
	// authenticated with a personal access token, this returns all webhooks
	// configured by all GraphQL clients for your account. For clients
	// authenticated with an OAuth 2.0 access token, this returns only webhooks
	// registered for your client.
	Webhooks *WebhookSubscriptionCursor `json:"webhooks"`
	// Returns details of a mailing list webhook subscription by its ID.
	Webhook *WebhookSubscription `json:"webhook,omitempty"`
}

func CreateMailingList added in v0.2.0

func CreateMailingList(client *gqlclient.Client, ctx context.Context, name string, description *string, visibility Visibility) (createMailingList *MailingList, err error)

func DeleteMailingList

func DeleteMailingList(client *gqlclient.Client, ctx context.Context, id int32) (deleteMailingList *MailingList, err error)

type MailingListACL

type MailingListACL struct {
	Id       int32          `json:"id"`
	Created  gqlclient.Time `json:"created"`
	List     *MailingList   `json:"list"`
	Entity   *Entity        `json:"entity"`
	Browse   bool           `json:"browse"`
	Reply    bool           `json:"reply"`
	Post     bool           `json:"post"`
	Moderate bool           `json:"moderate"`
}

These ACLs are configured for specific entities, and may be used to expand or constrain the rights of a participant.

func DeleteACL

func DeleteACL(client *gqlclient.Client, ctx context.Context, id int32) (deleteACL *MailingListACL, err error)

type MailingListACLCursor

type MailingListACLCursor struct {
	Results []MailingListACL `json:"results"`
	Cursor  *Cursor          `json:"cursor,omitempty"`
}

A cursor for enumerating ACL entries

If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.

type MailingListCursor

type MailingListCursor struct {
	Results []MailingList `json:"results"`
	Cursor  *Cursor       `json:"cursor,omitempty"`
}

A cursor for enumerating mailing lists

If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.

type MailingListEvent added in v0.2.0

type MailingListEvent struct {
	Uuid  string         `json:"uuid"`
	Event WebhookEvent   `json:"event"`
	Date  gqlclient.Time `json:"date"`
	List  *MailingList   `json:"list"`
}

type MailingListInput

type MailingListInput struct {
	Description *string     `json:"description,omitempty"`
	Visibility  *Visibility `json:"visibility,omitempty"`
	// List of globs for permitted or rejected mimetypes on this list
	// e.g. text/*
	PermitMime []string `json:"permitMime,omitempty"`
	RejectMime []string `json:"rejectMime,omitempty"`
}

type MailingListSubscription

type MailingListSubscription struct {
	Id      int32          `json:"id"`
	Created gqlclient.Time `json:"created"`
	List    *MailingList   `json:"list"`
}

func MailingListSubscribe

func MailingListSubscribe(client *gqlclient.Client, ctx context.Context, listID int32) (mailingListSubscribe *MailingListSubscription, err error)

func MailingListUnsubscribe

func MailingListUnsubscribe(client *gqlclient.Client, ctx context.Context, listID int32) (mailingListUnsubscribe *MailingListSubscription, err error)

type MailingListWebhookInput added in v0.2.0

type MailingListWebhookInput struct {
	Url    string         `json:"url"`
	Events []WebhookEvent `json:"events"`
	Query  string         `json:"query"`
}

type MailingListWebhookSubscription added in v0.2.0

type MailingListWebhookSubscription struct {
	Id         int32                  `json:"id"`
	Events     []WebhookEvent         `json:"events"`
	Query      string                 `json:"query"`
	Url        string                 `json:"url"`
	Client     *OAuthClient           `json:"client,omitempty"`
	Deliveries *WebhookDeliveryCursor `json:"deliveries"`
	Sample     string                 `json:"sample"`
	List       *MailingList           `json:"list"`
}

type OAuthClient added in v0.2.0

type OAuthClient struct {
	Uuid string `json:"uuid"`
}

type Patch

type Patch struct {
	Index   *int32  `json:"index,omitempty"`
	Count   *int32  `json:"count,omitempty"`
	Version *int32  `json:"version,omitempty"`
	Prefix  *string `json:"prefix,omitempty"`
	Subject *string `json:"subject,omitempty"`
}

Information parsed from the subject line of a patch, such that the following:

[PATCH myproject v2 3/4] Add foo to bar

Will produce:

index: 3
count: 4
version: 2
prefix: "myproject"
subject: "Add foo to bar"

type Patchset

type Patchset struct {
	Id           int32          `json:"id"`
	Created      gqlclient.Time `json:"created"`
	Updated      gqlclient.Time `json:"updated"`
	Subject      string         `json:"subject"`
	Version      int32          `json:"version"`
	Prefix       *string        `json:"prefix,omitempty"`
	Status       PatchsetStatus `json:"status"`
	Submitter    *Entity        `json:"submitter"`
	CoverLetter  *Email         `json:"coverLetter,omitempty"`
	Thread       *Thread        `json:"thread"`
	SupersededBy *Patchset      `json:"supersededBy,omitempty"`
	List         *MailingList   `json:"list"`
	Patches      *EmailCursor   `json:"patches"`
	Tools        []PatchsetTool `json:"tools"`
	// URL to an application/mbox archive of only the patches in this thread
	Mbox URL `json:"mbox"`
}

func PatchsetById

func PatchsetById(client *gqlclient.Client, ctx context.Context, id int32, cursor *Cursor) (patchset *Patchset, err error)

func UpdatePatchset

func UpdatePatchset(client *gqlclient.Client, ctx context.Context, id int32, status PatchsetStatus) (updatePatchset *Patchset, err error)

type PatchsetCursor

type PatchsetCursor struct {
	Results []Patchset `json:"results"`
	Cursor  *Cursor    `json:"cursor,omitempty"`
}

A cursor for enumerating patchsets

If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.

type PatchsetEvent added in v0.2.0

type PatchsetEvent struct {
	Uuid     string         `json:"uuid"`
	Event    WebhookEvent   `json:"event"`
	Date     gqlclient.Time `json:"date"`
	Patchset *Patchset      `json:"patchset"`
}

type PatchsetStatus

type PatchsetStatus string
const (
	PatchsetStatusUnknown       PatchsetStatus = "UNKNOWN"
	PatchsetStatusProposed      PatchsetStatus = "PROPOSED"
	PatchsetStatusNeedsRevision PatchsetStatus = "NEEDS_REVISION"
	PatchsetStatusSuperseded    PatchsetStatus = "SUPERSEDED"
	PatchsetStatusApproved      PatchsetStatus = "APPROVED"
	PatchsetStatusRejected      PatchsetStatus = "REJECTED"
	PatchsetStatusApplied       PatchsetStatus = "APPLIED"
)

func ParsePatchsetStatus

func ParsePatchsetStatus(s string) (PatchsetStatus, error)

func (PatchsetStatus) TermString

func (status PatchsetStatus) TermString() string

type PatchsetTool

type PatchsetTool struct {
	Id       int32          `json:"id"`
	Created  gqlclient.Time `json:"created"`
	Updated  gqlclient.Time `json:"updated"`
	Icon     ToolIcon       `json:"icon"`
	Details  string         `json:"details"`
	Patchset *Patchset      `json:"patchset"`
}

Used to add some kind of indicator for a third-party process associated with a patchset, such as a CI service validating the change.

type Thread

type Thread struct {
	Created      gqlclient.Time `json:"created"`
	Updated      gqlclient.Time `json:"updated"`
	Subject      string         `json:"subject"`
	Replies      int32          `json:"replies"`
	Participants int32          `json:"participants"`
	Sender       *Entity        `json:"sender"`
	Root         *Email         `json:"root"`
	List         *MailingList   `json:"list"`
	// Replies to this thread, in chronological order
	Descendants *EmailCursor `json:"descendants"`
	// A mailto: URI for replying to the latest message in this thread
	Mailto string `json:"mailto"`
	// URL to an application/mbox archive of this thread
	Mbox URL `json:"mbox"`
	// Thread parsed as a tree.
	//
	// The returned list is never empty. The first item is guaranteed to be the root
	// message. The blocks are sorted in topological order.
	Blocks []ThreadBlock `json:"blocks"`
}

type ThreadBlock added in v0.2.0

type ThreadBlock struct {
	// Unique identifier for this block.
	Key string `json:"key"`
	// The block's plain-text content.
	Body string `json:"body"`
	// Index of the parent block (if any) in Thread.blocks.
	Parent *int32 `json:"parent,omitempty"`
	// Replies to this block.
	//
	// The list items are indexes into Thread.blocks.
	Children []int32 `json:"children"`
	// The email this block comes from.
	Source *Email `json:"source"`
	// The range of this block in the source email body.
	SourceRange *ByteRange `json:"sourceRange"`
	// If this block is a reply to a particular chunk of the parent block, this
	// field indicates the range of that chunk in the parent's email body.
	ParentRange *ByteRange `json:"parentRange,omitempty"`
}

A block of text in an email thread.

Blocks are parts of a message's body that aren't quotes of the parent message. A block can be a reply to a parent block, in which case the parentStart and parentEnd fields indicate which part of the parent message is replied to. A block can have replies, each of which will be represented by a block in the children field.

type ThreadCursor

type ThreadCursor struct {
	Results []Thread `json:"results"`
	Cursor  *Cursor  `json:"cursor,omitempty"`
}

A cursor for enumerating threads

If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.

type ToolIcon

type ToolIcon string
const (
	ToolIconPending   ToolIcon = "PENDING"
	ToolIconWaiting   ToolIcon = "WAITING"
	ToolIconSuccess   ToolIcon = "SUCCESS"
	ToolIconFailed    ToolIcon = "FAILED"
	ToolIconCancelled ToolIcon = "CANCELLED"
)

type URL

type URL string

URL from which some secondary data may be retrieved. You must provide the same Authentication header to this address as you did to the GraphQL resolver which provided it. The URL is not guaranteed to be consistent for an extended length of time; applications should submit a new GraphQL query each time they wish to access the data at the provided URL.

type User

type User struct {
	Id            int32              `json:"id"`
	Created       gqlclient.Time     `json:"created"`
	Updated       gqlclient.Time     `json:"updated"`
	CanonicalName string             `json:"canonicalName"`
	Username      string             `json:"username"`
	Email         string             `json:"email"`
	Url           *string            `json:"url,omitempty"`
	Location      *string            `json:"location,omitempty"`
	Bio           *string            `json:"bio,omitempty"`
	List          *MailingList       `json:"list,omitempty"`
	Lists         *MailingListCursor `json:"lists,omitempty"`
	Emails        *EmailCursor       `json:"emails,omitempty"`
	Threads       *ThreadCursor      `json:"threads,omitempty"`
	Patches       *PatchsetCursor    `json:"patches,omitempty"`
}

A registered user

func AclByListName

func AclByListName(client *gqlclient.Client, ctx context.Context, name string, cursor *Cursor) (me *User, err error)

func AclByUser added in v0.4.0

func AclByUser(client *gqlclient.Client, ctx context.Context, username string, name string, cursor *Cursor) (user *User, err error)

func Archive added in v0.3.0

func Archive(client *gqlclient.Client, ctx context.Context, name string) (me *User, err error)

func ArchiveByUser added in v0.3.0

func ArchiveByUser(client *gqlclient.Client, ctx context.Context, username string, name string) (user *User, err error)

func CompleteLists added in v0.3.0

func CompleteLists(client *gqlclient.Client, ctx context.Context) (me *User, err error)

func CompletePatchsetId

func CompletePatchsetId(client *gqlclient.Client, ctx context.Context, name string) (me *User, err error)

func CompletePatchsetIdByUser added in v0.3.0

func CompletePatchsetIdByUser(client *gqlclient.Client, ctx context.Context, username string, name string) (user *User, err error)

func ExportMailingLists added in v0.2.0

func ExportMailingLists(client *gqlclient.Client, ctx context.Context, cursor *Cursor) (me *User, err error)

func ListPatches added in v0.3.0

func ListPatches(client *gqlclient.Client, ctx context.Context, name string, cursor *Cursor) (me *User, err error)

func ListPatchesByUser added in v0.3.0

func ListPatchesByUser(client *gqlclient.Client, ctx context.Context, username string, name string, cursor *Cursor) (user *User, err error)

func MailingListIDByName

func MailingListIDByName(client *gqlclient.Client, ctx context.Context, name string) (me *User, err error)

func MailingListIDByUser added in v0.3.0

func MailingListIDByUser(client *gqlclient.Client, ctx context.Context, username string, name string) (user *User, err error)

func MailingListWebhooks added in v0.3.0

func MailingListWebhooks(client *gqlclient.Client, ctx context.Context, name string, cursor *Cursor) (me *User, err error)

func MailingListWebhooksByUser added in v0.3.0

func MailingListWebhooksByUser(client *gqlclient.Client, ctx context.Context, username string, name string, cursor *Cursor) (user *User, err error)

func MailingLists

func MailingLists(client *gqlclient.Client, ctx context.Context, cursor *Cursor) (me *User, err error)

func MailingListsByUser

func MailingListsByUser(client *gqlclient.Client, ctx context.Context, username string, cursor *Cursor) (user *User, err error)

func Patches

func Patches(client *gqlclient.Client, ctx context.Context, cursor *Cursor) (me *User, err error)

func PatchesByUser

func PatchesByUser(client *gqlclient.Client, ctx context.Context, username string, cursor *Cursor) (user *User, err error)

type UserWebhookInput added in v0.2.0

type UserWebhookInput struct {
	Url    string         `json:"url"`
	Events []WebhookEvent `json:"events"`
	Query  string         `json:"query"`
}

type UserWebhookSubscription added in v0.2.0

type UserWebhookSubscription struct {
	Id         int32                  `json:"id"`
	Events     []WebhookEvent         `json:"events"`
	Query      string                 `json:"query"`
	Url        string                 `json:"url"`
	Client     *OAuthClient           `json:"client,omitempty"`
	Deliveries *WebhookDeliveryCursor `json:"deliveries"`
	Sample     string                 `json:"sample"`
}

type Version

type Version struct {
	Major int32 `json:"major"`
	Minor int32 `json:"minor"`
	Patch int32 `json:"patch"`
	// If this API version is scheduled for deprecation, this is the date on which
	// it will stop working; or null if this API version is not scheduled for
	// deprecation.
	DeprecationDate gqlclient.Time `json:"deprecationDate,omitempty"`
}

type Visibility added in v0.2.0

type Visibility string
const (
	VisibilityPublic   Visibility = "PUBLIC"
	VisibilityUnlisted Visibility = "UNLISTED"
	VisibilityPrivate  Visibility = "PRIVATE"
)

func ParseVisibility added in v0.2.0

func ParseVisibility(s string) (Visibility, error)

func (Visibility) TermString added in v0.2.0

func (visibility Visibility) TermString() string

type WebhookDelivery added in v0.2.0

type WebhookDelivery struct {
	Uuid         string               `json:"uuid"`
	Date         gqlclient.Time       `json:"date"`
	Event        WebhookEvent         `json:"event"`
	Subscription *WebhookSubscription `json:"subscription"`
	RequestBody  string               `json:"requestBody"`
	// These details are provided only after a response is received from the
	// remote server. If a response is sent whose Content-Type is not text/*, or
	// cannot be decoded as UTF-8, the response body will be null. It will be
	// truncated after 64 KiB.
	ResponseBody    *string `json:"responseBody,omitempty"`
	ResponseHeaders *string `json:"responseHeaders,omitempty"`
	ResponseStatus  *int32  `json:"responseStatus,omitempty"`
}

type WebhookDeliveryCursor added in v0.2.0

type WebhookDeliveryCursor struct {
	Results []WebhookDelivery `json:"results"`
	Cursor  *Cursor           `json:"cursor,omitempty"`
}

A cursor for enumerating a list of webhook deliveries

If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.

type WebhookEvent added in v0.2.0

type WebhookEvent string
const (
	WebhookEventListCreated      WebhookEvent = "LIST_CREATED"
	WebhookEventListUpdated      WebhookEvent = "LIST_UPDATED"
	WebhookEventListDeleted      WebhookEvent = "LIST_DELETED"
	WebhookEventEmailReceived    WebhookEvent = "EMAIL_RECEIVED"
	WebhookEventPatchsetReceived WebhookEvent = "PATCHSET_RECEIVED"
)

func ParseMailingListWebhookEvents added in v0.3.0

func ParseMailingListWebhookEvents(events []string) ([]WebhookEvent, error)

func ParseUserEvents added in v0.2.0

func ParseUserEvents(events []string) ([]WebhookEvent, error)

type WebhookPayload added in v0.2.0

type WebhookPayload struct {
	Uuid  string         `json:"uuid"`
	Event WebhookEvent   `json:"event"`
	Date  gqlclient.Time `json:"date"`

	// Underlying value of the GraphQL interface
	Value WebhookPayloadValue `json:"-"`
}

func (*WebhookPayload) UnmarshalJSON added in v0.4.0

func (base *WebhookPayload) UnmarshalJSON(b []byte) error

type WebhookPayloadValue added in v0.4.0

type WebhookPayloadValue interface {
	// contains filtered or unexported methods
}

WebhookPayloadValue is one of: MailingListEvent | EmailEvent | PatchsetEvent

type WebhookSubscription added in v0.2.0

type WebhookSubscription struct {
	Id     int32          `json:"id"`
	Events []WebhookEvent `json:"events"`
	Query  string         `json:"query"`
	Url    string         `json:"url"`
	// If this webhook was registered by an authorized OAuth 2.0 client, this
	// field is non-null.
	Client *OAuthClient `json:"client,omitempty"`
	// All deliveries which have been sent to this webhook.
	Deliveries *WebhookDeliveryCursor `json:"deliveries"`
	// Returns a sample payload for this subscription, for testing purposes
	Sample string `json:"sample"`

	// Underlying value of the GraphQL interface
	Value WebhookSubscriptionValue `json:"-"`
}

func CreateMailingListWebhook added in v0.3.0

func CreateMailingListWebhook(client *gqlclient.Client, ctx context.Context, listId int32, config MailingListWebhookInput) (createMailingListWebhook *WebhookSubscription, err error)

func CreateUserWebhook added in v0.2.0

func CreateUserWebhook(client *gqlclient.Client, ctx context.Context, config UserWebhookInput) (createUserWebhook *WebhookSubscription, err error)

func DeleteMailingListWebhook added in v0.3.0

func DeleteMailingListWebhook(client *gqlclient.Client, ctx context.Context, id int32) (deleteMailingListWebhook *WebhookSubscription, err error)

func DeleteUserWebhook added in v0.2.0

func DeleteUserWebhook(client *gqlclient.Client, ctx context.Context, id int32) (deleteUserWebhook *WebhookSubscription, err error)

func (*WebhookSubscription) UnmarshalJSON added in v0.4.0

func (base *WebhookSubscription) UnmarshalJSON(b []byte) error

type WebhookSubscriptionCursor added in v0.2.0

type WebhookSubscriptionCursor struct {
	Results []WebhookSubscription `json:"results"`
	Cursor  *Cursor               `json:"cursor,omitempty"`
}

A cursor for enumerating a list of webhook subscriptions

If there are additional results available, the cursor object may be passed back into the same endpoint to retrieve another page. If the cursor is null, there are no remaining results to return.

func UserWebhooks added in v0.2.0

func UserWebhooks(client *gqlclient.Client, ctx context.Context, cursor *Cursor) (userWebhooks *WebhookSubscriptionCursor, err error)

type WebhookSubscriptionValue added in v0.4.0

type WebhookSubscriptionValue interface {
	// contains filtered or unexported methods
}

WebhookSubscriptionValue is one of: UserWebhookSubscription | MailingListWebhookSubscription

Jump to

Keyboard shortcuts

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