orgs

package
v0.19.1069 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

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 New

func New(apiClient nuon.Client, cfg *config.Config) *Service

func (*Service) APIToken

func (s *Service) APIToken(ctx context.Context, asJSON bool) error

func (*Service) ConnectGithub

func (s *Service) ConnectGithub(ctx context.Context) error

func (*Service) Create

func (s *Service) Create(ctx context.Context, name string, isSandboxMode, noselect bool, asJSON bool) error

func (*Service) CreateInvite

func (s *Service) CreateInvite(ctx context.Context, email string, asJSON bool) error

func (*Service) CreateWebhook added in v0.19.901

func (s *Service) CreateWebhook(ctx context.Context, webhookURL, webhookSecret string, subscription SubscriptionFlags, asJSON bool) error

func (*Service) Current

func (s *Service) Current(ctx context.Context, asJSON bool) error

func (*Service) DeleteVCSConnection

func (s *Service) DeleteVCSConnection(ctx context.Context, connID string, asJSON bool) error

func (*Service) DeleteWebhook added in v0.19.901

func (s *Service) DeleteWebhook(ctx context.Context, webhookID string, asJSON bool) error

func (*Service) Deselect

func (s *Service) Deselect(ctx context.Context) error

func (*Service) ID

func (s *Service) ID(ctx context.Context, asJSON bool) error

func (*Service) List

func (s *Service) List(ctx context.Context, offset, limit int, search string, asJSON bool) error

func (*Service) ListInvites

func (s *Service) ListInvites(ctx context.Context, offset, limit int, asJSON bool) error

func (*Service) ListWebhooks added in v0.19.901

func (s *Service) ListWebhooks(ctx context.Context, asJSON bool) error

func (*Service) PrintConfig

func (s *Service) PrintConfig(asJSON bool) error

func (*Service) Select

func (s *Service) Select(ctx context.Context, orgID string, offset, limit int, asJSON bool) error

func (*Service) SetCurrent

func (s *Service) SetCurrent(ctx context.Context, orgID string, asJSON bool)

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.

func (*Service) VCSConnections

func (s *Service) VCSConnections(ctx context.Context, offset, limit int, asJSON bool) error

type SubscriptionFlags added in v0.19.927

type SubscriptionFlags struct {
	JSON string
	File string
}

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

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.

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.

Jump to

Keyboard shortcuts

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