Documentation
¶
Index ¶
- type Service
- func (s *Service) APIToken(ctx context.Context, asJSON bool) error
- func (s *Service) ConnectGithub(ctx context.Context) error
- func (s *Service) Create(ctx context.Context, name string, isSandboxMode, noselect bool, asJSON bool) error
- func (s *Service) CreateInvite(ctx context.Context, email string, asJSON bool) error
- func (s *Service) CreateWebhook(ctx context.Context, webhookURL, webhookSecret string, ...) error
- func (s *Service) Current(ctx context.Context, asJSON bool) error
- func (s *Service) DeleteVCSConnection(ctx context.Context, connID string, asJSON bool) error
- func (s *Service) DeleteWebhook(ctx context.Context, webhookID string, asJSON bool) error
- func (s *Service) Deselect(ctx context.Context) error
- func (s *Service) ID(ctx context.Context, asJSON bool) error
- func (s *Service) List(ctx context.Context, offset, limit int, search string, asJSON bool) error
- func (s *Service) ListInvites(ctx context.Context, offset, limit int, asJSON bool) error
- func (s *Service) ListWebhooks(ctx context.Context, asJSON bool) error
- func (s *Service) PrintConfig(asJSON bool) error
- func (s *Service) Select(ctx context.Context, orgID string, offset, limit int, asJSON bool) error
- func (s *Service) SetCurrent(ctx context.Context, orgID string, asJSON bool)
- func (s *Service) UpdateWebhook(ctx context.Context, webhookID, webhookSecret string, ...) error
- func (s *Service) VCSConnections(ctx context.Context, offset, limit int, asJSON bool) error
- type SubscriptionFlags
- type SubscriptionPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) CreateInvite ¶
func (*Service) CreateWebhook ¶ added in v0.19.901
func (*Service) DeleteVCSConnection ¶
func (*Service) DeleteWebhook ¶ added in v0.19.901
func (*Service) ListInvites ¶
func (*Service) ListWebhooks ¶ added in v0.19.901
func (*Service) PrintConfig ¶
func (*Service) SetCurrent ¶
func (*Service) UpdateWebhook ¶ added in v0.19.915
func (s *Service) UpdateWebhook( ctx context.Context, webhookID, webhookSecret string, subscription SubscriptionFlags, asJSON bool, ) error
UpdateWebhook calls PATCH /v1/orgs/current/webhooks/{webhook_id} to replace the webhook subscription (interests + match) and optionally rotate the signing secret.
The interests filter and match predicate are replaced wholesale every call: omitting --subscription-json / --subscription-file resets the webhook to the implicit default (every event in the org, no scoping).
When webhookSecret is empty, the existing secret is left unchanged. When non-empty, the API replaces the stored secret with the provided value. Removing a secret entirely (delivering payloads unsigned) is intentionally not exposed by the CLI — the SDK's swagger model serializes the field with omitempty so an empty string cannot be transmitted; use the dashboard for that case.
type SubscriptionFlags ¶ added in v0.19.927
SubscriptionFlags collects the CLI flags shared by `webhooks create` and `webhooks update` describing the full webhook subscription — both the interests filter (which events fire) and the optional match predicate (which entities are in scope).
Exactly one of (--subscription-json, --subscription-file) may be set. When neither is set, Resolve returns the implicit default: subscribe to every event in the org (interests = {"all_events": true}, match = nil).
func (SubscriptionFlags) Resolve ¶ added in v0.19.927
func (f SubscriptionFlags) Resolve() (SubscriptionPayload, error)
Resolve turns the raw flag values into the parsed subscription payload the request builders pass into the SDK.
- --subscription-file path : reads JSON from disk
- --subscription-json '{…}': parses inline JSON
- neither : defaults to AllEvents + org-wide
The JSON shape is `{"interests": {...}, "match": {...}}` — both keys optional. A missing "interests" defaults to {"all_events": true} so the caller can scope a webhook with `--subscription-json '{"match":{...}}'` without restating the events filter.
type SubscriptionPayload ¶ added in v0.19.927
type SubscriptionPayload struct {
Interests any `json:"interests"`
Match *labels.SubscriptionMatch `json:"match"`
}
SubscriptionPayload is the parsed shape of the unified subscription file or inline JSON. Both fields are optional. The wire types are deliberately `any` so the CLI is agnostic to the server's internal Interests struct (which lives in services/ctl-api/internal/pkg/interests and is not part of the public SDK).
Match is a *labels.SubscriptionMatch so we can run client-side Validate() before paying for an HTTP round-trip; a nil pointer (or omitted "match" key) preserves the legacy "match every event in the org" semantics.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
pickers.go houses the data-driven entity pickers that fire after the main subscription form (tui.go) when the user selects "specific" for a given kind.
|
pickers.go houses the data-driven entity pickers that fire after the main subscription form (tui.go) when the user selects "specific" for a given kind. |