Documentation
¶
Index ¶
- type InterestsFlags
- 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, interests InterestsFlags, ...) error
- func (s *Service) VCSConnections(ctx context.Context, offset, limit int, asJSON bool) error
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 (*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, 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.