orgs

package
v0.19.921 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InterestsFlags added in v0.19.915

type InterestsFlags struct {
	AllEvents      bool
	InterestsJSON  string
	InterestsFile  string
	AllEventsIsSet bool
}

InterestsFlags collects the CLI flags shared by the `webhooks create` and `webhooks update` subcommands. Exactly one of (--all-events, --interests-json, --interests-file) may be set; --all-events is the implicit default when none is provided so that callers don't accidentally save an "empty" config that drops every event.

func (InterestsFlags) Resolve added in v0.19.915

func (f InterestsFlags) Resolve() (any, error)

Resolve turns the raw flag values into the JSON-shaped interests payload the API expects (mirrors internal/pkg/interests.Interests).

  • --interests-file path : reads JSON from disk
  • --interests-json '{…}': parses inline JSON
  • --all-events / nothing: sends {"all_events":true}

Server-side validation is authoritative; the CLI only ensures the bytes parse as JSON before sending. Mixing flags returns an error to keep CLI semantics unambiguous.

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, interests InterestsFlags, 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,
	interests InterestsFlags,
	asJSON bool,
) error

UpdateWebhook calls PATCH /v1/orgs/current/webhooks/{webhook_id} to replace the interests filter and optionally rotate the signing secret.

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

Jump to

Keyboard shortcuts

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